01.10.2010, 19:17
i have another but ...
pawn Код:
if(strcmp(cmd, "/goto", true) == 0) {
if(PlayerInfo[playerid][Level] >= 2) {
new player1, tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, red, "USAGE: /goto [playerid]");
return 1; }
player1 = strval(tmp);
if(IsPlayerConnected(player1)) {
CMDMessageToAdmins(playerid,"GOTO");
new Float:x, Float:y, Float:z; GetPlayerPos(player1,x,y,z); SetPlayerInterior(playerid,GetPlayerInterior(player1));
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(player1));
if(GetPlayerState(playerid) == 2) {
SetVehiclePos(GetPlayerVehicleID(playerid),x+3,y,z); LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(player1));
SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),GetPlayerVirtualWorld(player1));
} else {
SetPlayerPos(playerid,x+2,y,z); }
GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname));
//format(string,256,"Administrator %s has teleported to you",adminname); SendClientMessage(player1,blue,string);
format(string,256,"You have teleported to %s", playername); SendClientMessage(playerid,blue,string);
return 1;
} else {
SendClientMessage(playerid, red, "Player is not connected");
return 1; }
} else {
SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command"); }
return 1; }