01.02.2009, 19:22
ok heres what i got so far, but it only take you to the player, i need it to take the player back to where he WAS.
also, he cant do this on TEAM_AGENT , TEAM_NEO, TEAM_SMITH
also, he cant do this on TEAM_AGENT , TEAM_NEO, TEAM_SMITH
Code:
if(strcmp(cmd, "/switch", true == 0) && gTeam[playerid] == TEAM_AGENT ) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_ERROR, "USAGE: /switch (id)"); return 1; } giveplayerid = strval(tmp); if(!IsNumeric(tmp)) { SendClientMessage(playerid, COLOR_ERROR, "USAGE: /switch (id) ID Must be a number"); return 1; } if (IsPlayerConnected(giveplayerid)) { SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid)); new Float:x, Float:y, Float:z; new pname[24]; new aname[24]; GetPlayerPos(giveplayerid, x,y,z); SetPlayerPos(playerid, x+1,y,z); GetPlayerName(giveplayerid, pname, 24); GetPlayerName(playerid, aname, 24); SendClientMessage(playerid, 0xA9A9A9AA, "|_Special Ability Used_|"); format(string, sizeof(string), "You have teleported to %s(%d)",pname,giveplayerid); SendClientMessage(playerid,0xFF7F50AA, string); format(string, sizeof(string), "%s(%d) has teleported to %s(%d) [ABILITY COMMAND /SWITCH]",aname,playerid,pname,giveplayerid); printf("%s", string); } else { format(string, sizeof(string), "ID (%d) Is not an active player", giveplayerid); SendClientMessage(playerid, COLOR_ERROR, string); } return 1; }