protect command
#3

not work , what The correct code ?
Quote:

CMDgoto(playerid,params[])
{
if(PlayerInfo[playerid][LoggedIn] == 0) {
SendClientMessage(playerid, COLOR_BRIGHTRED, "ERROR: You need to be registered to access this command");
return 1;
}
new teleid;
if(sscanf(params,"u",teleid)) return SendClientMessage(playerid, red, "Usage:/pgoto [playerid]");
if(!IsPlayerConnected(teleid)) return SendClientMessage(playerid, red, "Player is not connected");
if(teleid == INVALID_PLAYER_ID) return SendClientMessage(playerid, red, "This isn't a valid player ID");
if(tele[teleid]==1) return SendClientMessage(playerid, red, "Player has not enabled tele command");
new Float:telex,Float:teley,Float:telez,int;
GetPlayerPos(teleid,telex,teley,telez);
int = GetPlayerInterior(teleid);
new last_pgoto[MAX_PLAYERS];
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new vid = GetPlayerVehicleID(playerid);
SetVehiclePos(vid, telex, teley, telez+1);
LinkVehicleToInterior(vid, int);
if((gettime() - last_pgoto[playerid]) < 5)
return SendClientMessage(playerid, -1, "wait");
}
else
{
SetPlayerPos(playerid,telex,teley,telez+1);
SetPlayerInterior(playerid,int);
}
last_pgoto[playerid] = gettime();
return 1;
}

Reply


Messages In This Thread
protect command - by s3ek - 31.01.2015, 19:08
Re: protect command - by zPain - 31.01.2015, 19:17
Re: protect command - by s3ek - 31.01.2015, 21:56
Re: protect command - by zPain - 01.02.2015, 00:52
Re: protect command - by s3ek - 01.02.2015, 02:06

Forum Jump:


Users browsing this thread: 1 Guest(s)