[pawn]//--------------------------------Command------------------------------------------\\
if (strcmp(cmd, "!goto", true) == 0) { tmp = strtok(cmdtext, idx); if(PlayerInfo[playerid][Logged] != 1) SendClientMessage(playerid, COLOR_RED, "You need to login first!"); else if(!strlen(tmp)) SendClientMessage(playerid, COLOR_GREY, "Usage: !goto [Nick/ID]"); else { new plr = FindPlayerIDFromString(tmp); if (plr == INACTIVE_PLAYER_ID) SendClientMessage(playerid,COLOR_GREEN,"Error: Unknown player"); else if (PlayerInfo[plr][NoGoto] == 1) SendClientMessagef(playerid,COLOR_GREEN, "%s has goto Disabled.",strval(gPlayers[plr])); else if (!IsPlayerSpawned(plr)) SendClientMessagef(playerid,COLOR_GREEN, "Error: %s does not spawned!",gPlayers[plr]); else { SendClientMessage(playerid, COLOR_GREEN,">> pm** Please wait <5> Seconds..."); format(szMsg,sizeof(szMsg),"[%d]%s is this teleporting toward you",playerid,gPlayers[playerid]); SendClientMessage(plr,COLOR_GREEN, szMsg); GameTextForPlayer(playerid,"~h~tp.."); SetTimer("GOTO", 3000, 0, player, plr ); } } return 1; }
//------------------------------------------FUNCTION---------------------------------------------------\\
public GOTO(plr, playerid) { new szMsg[256], Float:x, Float:y, Float:z; GetPlayerPos(plr,x,y,z); SetPlayerPos(playerid,x,y + 1.0,z,0,0); format(szMsg,sizeof(szMsg),"Teleporting:[ %s ] to:[ %s ]",gPlayers[playerid],gPlayers[plr]); SendClientMessageToAll(COLOR_GREEN, szMsg); }[/pawn] |