17.09.2015, 13:51
I didn't find "GetPlayerClass" function on sa-mp wiki, I assume that you have this function in your gamemode, however try this code:
if GetPlayerClass isn't a function in your gamemode, just save the number of the class of the player in a variable.
I hope I helped any feedback is appreciated!
pawn Code:
CMD:cuff(playerid, params[])
{
if(GetPlayerClass(playerid) == COP_CLASS)
{
if(GetPlayerWantedLevel(playerid) >= 3)) return SendClientMessage(playerid, -1, "You can't cuff that player");
{
SetPlayerSpecialAction(playerid,24);
SetPlayerAttachedObject(playerid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
}
}
return 1;
}
CMD:arrest(playerid, params[])
{
if(GetPlayerClass(playerid) == COP_CLASS)
{
if(GetPlayerWantedLevel(playerid) >= 3)) return SendClientMessage(playerid, -1, "Player isn't wanted!");
{
SetPlayerInterior(id, 3);//sets player interior
SetPlayerVirtualWorld(playerid, 10);//sets player vw
SetPlayerFacingAngle(playerid, 360.0);//player angle
SetPlayerPos(id, 197.5662, 175.4800, 1004.0);//player pos
SetPlayerHealth(id, 9999999999.0);//player cannot be killed
ResetPlayerWeapons(playerid);//resets his weapons
JailTimer[playerid] = 60000;
SetPlayerWantedLevel(playerid, 0);
}
}
return 1;
}
I hope I helped any feedback is appreciated!