Small question.
#2

PHP код:
dcmd_detenir(playerid,params[]) 

    new 
string[128]; 
    new 
ID
    if(
sscanf(params"u"ID)) 
    { 
        
SendClientMessage(playerid,COLOR_ERROR,"Utilisation: /detenir (Nom de joueur/ID)"); 
        return 
1
    } 
    if(
IsSpawned[playerid] != 1
    { 
        
SendClientMessage(playerid,COLOR_ERROR,"Vous devez spawn pour pouvoir utiliser cette commande."); 
        return 
1
    } 
        
format(string,sizeof(string),"[RADIO DE POLICE] L'officier de police %s(%d) a dйtenu %s(%d) dans son vйhicule.",PlayerName(playerid),playerid,PlayerName(ID),ID); 
        
SendClientMessageToAll(COLOR_DODGERBLUE,string); 
        
SendClientMessage(ID,COLOR_DEADCONNECT,"[[_Detenir_]]"); 
        
format(string,sizeof(string),"L'officier de police %s(%d) vous a dйtenu.",PlayerName(playerid),playerid); 
        
SendClientMessage(ID,COLOR_DODGERBLUE,string); 
        
SendClientMessage(playerid,COLOR_DEADCONNECT,"[[_Detenir_]]"); 
        
format(string,sizeof(string),"Vous avez dйtenu %s(%d) dans votre vehicule.",PlayerName(ID),ID); 
        
SendClientMessage(playerid,COLOR_DODGERBLUE,string); 
        
GameTextForPlayer(ID,"~R~Vous avez ete detenu par un policier . Aie vous кtes foutue :/.",5000,4); 
        new 
Seats PutPlayerInEmptyVehicleSeat(LastVehicle[playerid],ID);
        if(
Seats != INVALID_PLAYER_ID)
        {
         
SendClientMessage(playerid,COLOR_ERROR,"No free seats");
        }
        
    return 
1
}  
forward PutPlayerInEmptyVehicleSeat(vehicleid,playerid);
public 
PutPlayerInEmptyVehicleSeat(vehicleid,playerid)
{
    new 
bool:Seat[4],seat;
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerInVehicle(i,vehicleid))
        {
            
seat GetPlayerVehicleSeat(i);
            if(!(
<= seat sizeof(Seat))) seat sizeof(Seat)-1;
            
Seat[seat] = true;
        }
    }
    for(new 
seatID sizeof(Seat)-1seatID > -1seatID--)
        if(!
Seat[seatID])
        {
            
seat INVALID_PLAYER_ID;
            
PutPlayerInVehicle(playerid,vehicleid,seatID);
            break;
        }
    return 
seat;

Reply


Messages In This Thread
Small question. - by KillerDVX - 10.04.2016, 23:42
Re: Small question. - by Jelly23 - 11.04.2016, 00:11
Re: Small question. - by KillerDVX - 11.04.2016, 10:29

Forum Jump:


Users browsing this thread: 1 Guest(s)