06.11.2011, 01:11
Detects if the player is in a vehicle, and brings it with him. Just login to RCON.
pawn Код:
CMD:get(playerid, params[])
{
if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, red, "{FF0000}ERROR:{FFFFFF} Invalid Command, {FF0000}[/HELP] {FFFFFF}or {FF0000}[/CMDS].");
{
new Float:x, Float:y, Float:z, ID, string[128];
if(sscanf(params, "u", ID)) return SendClientMessage( playerid, white, "USAGE: /get [playerid/partofname]");
{
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid,red,"That player is not connected.");
if(ID == playerid) return SendClientMessage(playerid,red,"You cannot get yourself.");
if(GetPlayerState(ID) == PLAYER_STATE_DRIVER)
{
new veh = GetPlayerVehicleID(ID);
SetPlayerVirtualWorld(ID, GetPlayerVirtualWorld(playerid));
SetPlayerInterior(ID, GetPlayerInterior(playerid));
GetPlayerPos(playerid,x,y,z);
SetVehiclePos(veh,x,y+1,z);
PutPlayerInVehicle(ID, veh, 0);
}
else
{
SetPlayerVirtualWorld(ID, GetPlayerVirtualWorld(playerid));
SetPlayerInterior(ID, GetPlayerInterior(playerid));
GetPlayerPos(playerid,x,y,z);
SetPlayerPos(ID,x,y+1,z);
}
GetPlayerName(playerid, pname, sizeof(pname));
format(string,sizeof(string),"You have been teleported to {FF0000}%s", pname);
SendClientMessage(ID, white, string);
GetPlayerName(ID, pname, sizeof(pname));
format(string,sizeof(string),"%s{FFFFFF} has been teleported to you.", pname);
SendClientMessage(playerid, red, string);
}
}
return 1;
}