29.07.2013, 15:53
How can I make my goto and get command take your car too
Код HTML:
//goto CMD:goto(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] > 1) //== You would have something similar or you might not have it if you want anyone in the server to use the command { new Float:x, Float:y, Float:z, targetid; if(sscanf(params,"u", targetid)) return SendClientMessage(playerid, COLOR_RED, "Usage: /goto [Player ID/Name]"); if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED, "Error: This player is not connected."); GetPlayerPos(targetid, x, y, z); //== Get's the player position of the player you wish to go to SetPlayerPos(playerid, x, y, z); //== Set's your position to his } else SendClientMessage(playerid, COLOR_RED, "You are not at least a level 1 admin!"); //== If the player trying to use the command is not admin they will get this return 1; } //get CMD:get(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] > 1) { new Float:x, Float:y, Float:z, targetid; if(sscanf(params,"u", targetid)) return SendClientMessage(playerid, COLOR_RED, "Usage: /get [Player ID/Name]"); if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED, "Error: This player is not connected."); GetPlayerPos(playerid, x, y, z); //== Same as above only here the code will get your position SetPlayerPos(targetid, x, y+1, z); //== And bring the target to you } else SendClientMessage(playerid, COLOR_RED, "You are not at least a level 1 admin!"); return 1; }