Getting Problem in Event command
#1

Hello! That is my Command to give vehicles to ALL Players in Event !

pawn Код:
CMD:ecar(playerid, params[])
{
    if(pInfo[playerid][pWSELevel] > 1) return 0;
    if( GetPlayerVirtualWorld( playerid ) != 1 ) return SendClientMessage( playerid, COLOR_RED, "[ ! ] You can't use Event Commands in Real World !" );
    new
        Modelo,
        Cor1,
        Cor2
    ;

    if(sscanf(params,"ddd",Modelo,Cor1,Cor2))return SendClientMessage(playerid , COLOR_LIGHTGREEN , "[ ! ] USAGE: /ecar <id> <color1> <color2>" ) ;
    new Float:CarPos[4], CarID;
    for ( new v, b = GetMaxPlayers(); v != b; v++ )
    {
    GetPlayerFacingAngle ( v , CarPos [ 3 ] ) ;
    GetPlayerPos ( v , CarPos [ 0 ] , CarPos [ 1 ] , CarPos [ 2 ] ) ;
    CarID = CreateVehicle ( Modelo , CarPos [ 0 ] +2 , CarPos [ 1 ] , CarPos [ 2 ] , CarPos [ 3 ] , Cor1 , Cor2 , 0x00C0FFFF ) ;
    LinkVehicleToInterior ( CarID , 0 ) ;
    SetVehicleVirtualWorld ( CarID , 1 ) ;
    PutPlayerInVehicle ( v , CarID , 0 ) ;
    }
    return 1;
}
But the Problem is, It is giving me vehicle too, But I don't want. I just want that It gives players vehicle only.
And the Second Problem is, It is giving More then 1 Vehicle to me. But I want it gives only...
Reply
#2

pawn Код:
if(!IsPlayerConnected(v) || v == playerid) continue;
Put this before "GetPlayerFacingAngle(v, CarPos[3]);"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)