23.11.2009, 19:31
I have 1 problem ..
I want that my /goto command teleports player with his/her car.
My /goto CMD :
Oops.. i forgot :
/get CMD too what teleports player with his/her car to me.
/get CMD :
I want that my /goto command teleports player with his/her car.
My /goto CMD :
Код:
if(strcmp(cmd, "/goto", true) == 0 && PlayerAdminLevel[playerid] == 1337) // Teleports Admin To A Player { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_ERROR, "USAGE: /goto (id)"); return 1; } giveplayerid = strval(tmp); if(!IsNumeric(tmp)) { SendClientMessage(playerid, COLOR_ERROR, "USAGE: /goto (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, "|_Admin Command 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) [ADMIN COMMAND /GOTO]",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; }
/get CMD too what teleports player with his/her car to me.
/get CMD :
Код:
if(strcmp(cmd, "/get", true) == 0 && PlayerAdminLevel[playerid] == 1337) // Brings A Player To Admin { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_ERROR, "USAGE: /get (id)"); return 1; } giveplayerid = strval(tmp); if(!IsNumeric(tmp)) { SendClientMessage(playerid, COLOR_ERROR, "USAGE: /get (id) ID Must be a number"); return 1; } if (IsPlayerConnected(giveplayerid)) { SetPlayerInterior(giveplayerid, GetPlayerInterior(playerid)); new Float:x, Float:y, Float:z; new pname[24]; new aname[24]; GetPlayerPos(playerid, x,y,z); SetPlayerPos(giveplayerid, x+1,y,z); SetPlayerVirtualWorld(giveplayerid,GetPlayerVirtualWorld(playerid)); GetPlayerName(giveplayerid, pname, 24); GetPlayerName(playerid, aname, 24); SendClientMessage(playerid, 0xA9A9A9AA, "|_Admin Command Used_|"); format(string, sizeof(string), "You have brought (teleported) %s(%d) to you",pname,giveplayerid); SendClientMessage(playerid,0xFF7F50AA, string); format(string, sizeof(string), "%s(%d) has brought (teleported) %s(%d) [ADMIN COMMAND /BRING]",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;