if(IsPlayerInAnyVehicle(playerid))
#1

How can I detect, if player is in a car, and if it's, how can I /gethere him with the car and passagers still in IT?


PHP код:
CMD:gethere(playerid,params[])
{
    if(
pInfo[playerid][pAdminLevel] >= 1)
    {
        new 
targetid,string[256], str1[256];
          if(
sscanf(params"u"targetid)) SendClientMessage(playerid,-1,""COL_RED"AdmCmds: /gethere [PlayerID]");
        if(!
IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,""COL_RED"ERROR: Not online!");
        new 
Float:xFloat:yFloat:z;
        
GetPlayerPos(playeridxyz);
        
SetPlayerPos_Allow(targetidx+1y+1z+1);
        
GetPlayerPos(playerid,Float:x,Float:y,Float:z);
        
SetPlayerVirtualWorld(targetid,GetPlayerVirtualWorld(playerid));
        
format(stringsizeof(string), ""COL_RED"AdmCmds: %s %s has brought you to himself."GetAdminName(playerid), PlayerName(playerid));
        
format(str1sizeof(str1), ""COL_RED"%s %s used /gethere upon %s."GetAdminName(playerid),PlayerName(playerid),PlayerName(targetid));
        
SendClientMessage(targetid,-1,string);
        
SendMessageToAllAdmins(str1,-1);
        if(
IsPlayerInAnyVehicle(targetid))
          {
              
SetVehiclePos(GetPlayerVehicleID(targetid),x,y,z);
        }
    }
    else {
        
SendClientMessage(playerid,-1,""COL_RED"EROARE: You are not admin!");
    }
    return 
1;

Reply


Messages In This Thread
if(IsPlayerInAnyVehicle(playerid)) - by Zeus666 - 27.10.2018, 18:30
Re: if(IsPlayerInAnyVehicle(playerid)) - by RogueDrifter - 27.10.2018, 18:39
Re: if(IsPlayerInAnyVehicle(playerid)) - by ReD_HunTeR - 27.10.2018, 18:44
Re: if(IsPlayerInAnyVehicle(playerid)) - by RogueDrifter - 27.10.2018, 18:55

Forum Jump:


Users browsing this thread: 1 Guest(s)