19.11.2011, 15:44
Hi guys, I need little help with ladmin dcmd_goto
Kk, so I need to do this function:
1id player in 0 (standart) world, and player 2id in 5 (custom) world.
So, when player (1id) /goto id2 you will can't, and system will show - ERROR: Player is in other world
When player's 1 and 2 is in 0 (standart) world - 1id will can goto player 2id
Sorry for my bad English language.
Kk, so I need to do this function:
1id player in 0 (standart) world, and player 2id in 5 (custom) world.
So, when player (1id) /goto id2 you will can't, and system will show - ERROR: Player is in other world
When player's 1 and 2 is in 0 (standart) world - 1id will can goto player 2id
Quote:
dcmd_goto(playerid,params[]) { if(PlayerInfo[playerid][Level] >= 0 || IsPlayerAdmin(playerid)) { if(!strlen(params)) return SendClientMessage(playerid,red,"Usage: /goto [playerID]"); new player1, string[128]; if(!IsNumeric(params)) player1 = ReturnPlayerID(params); else player1 = strval(params); if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid) { CMDMessageToAdmins(playerid,"GOTO"); new Float, Float:y, Float:z; GetPlayerPos(player1,x,y,z); SetPlayerInterior(playerid,GetPlayerInterior(playe r1)); SetPlayerVirtualWorld(playerid,GetPlayerVirtualWor ld(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); format(string,sizeof(string),"You went to {FF0000}\"%s\"", pName(player1)); return SendClientMessage(playerid,blue,string); } else return SendClientMessage(playerid, red, "{FF0000}You cannot go yourself"); } else return SendClientMessage(playerid,red,"{FF0000}ERROR{FFFF FF}: You don't have Administrator permission"); } |