31.01.2015, 21:56
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; } |