Command not working
#1

pawn Код:
if (strcmp("/siren", cmdtext, true, 10) == 0) // frontal siren
    {
    new vehicleid = GetPlayerVehicleID(playerid);
    if(GetPlayerVehicleID(playerid) == 560 && GetPlayerState(playerid) == 2 && PlayerData[playerid][LAERank] >= 1)
    {
    siren[vehicleid] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
    siren2[vehicleid] = CreateObject(19419, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
    AttachObjectToVehicle(siren[vehicleid], vehicleid, 0.000000, 0.000000, 0.809999, 0.000000, 0.000000, 0.000000); //Object Model: 19419 |  Sultan siren 1
    AttachObjectToVehicle(siren2[vehicleid], vehicleid, 0.000000, 0.000000, 0.814999, 0.000000, 0.000000, 0.000000); //Object Model: 18646 |  sultan siren 2
    } else { SendClientMessage(playerid, RED, "You do not have a high-enough LAE rank!"); }
    return 1;
    }
Can someone tell me what's wrong with this ? I want it to be that the player must be inside the vehicle as a driver, it has to be a sultan, and his LAE rank must be 1 or higher in order to perform the command, or otherwise he would receive the "you dont have high enough lae rank" message.
Reply
#2

Use "GetVehicleModel" to check the model of it, not "GetPlayerVehicleID"
pawn Код:
if(GetVehicleModel(vehicleid) == 560 && GetPlayerState(playerid) == 2 && PlayerData[playerid][LAERank] >= 1)
Reply
#3

thanks man it worked
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)