SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 05/10/2010, 02:57 PM   #1
nejc001
Big Clucker
 
Join Date: May 2010
Location: Slovenia
Posts: 161
Reputation: 0
Question Timer problem

When i write /lol after 5 seconds it should teleport me to some position i set.
Check this.
Code:
forward loltimer();            // at top


    if(!strcmp(cmdtext, "/lol", true))      // in  "public OnPlayerCommandText(playerid, cmdtext[])"
    {
            SetTimer("loltimer", 5000, false);
            return 1;
        }
           return 1;
        }


public loltimer()
{
            SetPlayerPos(playerid,2482.2227,-1646.2852,18.3521);
            return 1;
            }
I get error that "playerid" in "SetPlayerPos" line is not defined. I Dont Know what to do.
nejc001 is offline  
Old 05/10/2010, 03:02 PM   #2
Matej_
Gangsta
 
Matej_'s Avatar
 
Join Date: Aug 2010
Posts: 578
Reputation: 0
Default Re: Timer problem

Try this:

pawn Code:
new loltimer;                    // at the top
forward loltimer();            // at top


if(!strcmp(cmdtext, "/lol", true))      // in  "public OnPlayerCommandText(playerid, cmdtext[])"
{
   loltimer = SetTimer("loltimer", 5000, false);
    return 1;
 }

public loltimer()
{
  SetPlayerPos(playerid,2482.2227,-1646.2852,18.3521);
  return 1;
}
Matej_ is offline  
Old 05/10/2010, 03:04 PM   #3
Bumbis
Huge Clucker
 
Bumbis's Avatar
 
Join Date: Jan 2010
Location: Latvia
Posts: 203
Reputation: 4
Default Re: Timer problem

pawn Code:
forward loltimer(playerid);

if(!strcmp(cmdtext,"/lol",true))
{
     SetTimerEx("loltimer", 5000, false,"i",playerid);
     return 1;
}


public loltimer(playerid)
{
SetPlayerPos(playerid,2482.2227,-1646.2852,18.3521);
return 1;
}
__________________
Filterscripts:
Speedo & Radar
Fishing System
Maps:
Los Santos Pier
Bumbis is offline  
Old 05/10/2010, 03:08 PM   #4
nejc001
Big Clucker
 
Join Date: May 2010
Location: Slovenia
Posts: 161
Reputation: 0
Default Re: Timer problem

OK, tnx, works.
nejc001 is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Timer Problem yeswecanchange09 Help Archive 3 12/06/2010 03:26 PM
Problem with timer. Freddy19 Help Archive 3 05/06/2010 08:30 PM
Timer does problem again deather Help Archive 0 27/01/2010 12:55 PM


All times are GMT. The time now is 05:49 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.