SA-MP Forums Archive
Command not working - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Command not working (/showthread.php?tid=388164)



Command not working - stix - 27.10.2012

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.


Re: Command not working - Catalyst- - 27.10.2012

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



Respuesta: Command not working - stix - 27.10.2012

thanks man it worked