Timer On Teleport
#1

Hello, i'm trying to put a timer on my teleport so people can only use the /telehome command once every Min.
iv'e looked on Wiki, and the timer made no sense to me, so how would i put a timer on this?:
Quote:

if(strcmp(cmdtext,"/Telehome",true)==0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehicleid = GetPlayerVehicleID(playerid);
SetVehiclePos(vehicleid, 2167.8123,1422.5269,10.8203);
}
else
{
SetPlayerPos(playerid, 2167.8123,1422.5269,10.8203);
}
}
return 1;
}

Reply
#2

pawn Код:
// Use the one below, much better and faster.
Reply
#3

Use gettime and global variables.

Try this,
pawn Код:
CMD:tele(playerid, params[]){
    #pragma unused params
   
   
    static
        go[MAX_PLAYERS]
    ;
   
    if((go[playerid] != 0) && gettime() - go[playerid] < 60){
        go[playerid] = gettime();
        return SendClientMessage(playerid, -1,"NOT");
    }
   
    go[playerid] = gettime();
    SetPlayerPos(playerid, 2167.8123,1422.5269,10.8203);
    return true;
}
Reply
#4

Thx, But how do i put it in? Lol sorry im noob at this
Reply
#5

just copy this to ur script
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)