ERRORS!
#1

Code:
error 022: must be lvalue (non-constant)
error 029: invalid expression, assumed zero
error 001: expected token: ";", but found ")"
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 was trying to make cuff and arrest cmds for cops..
Reply
#2

Quote:
Originally Posted by TheKnown
View Post
if(GetPlayerWantedLevel(playerid) => 3)) return SendClientMessage(playerid, -1, "You can't cuff that .
Look at these rows...it should be:

PHP Code:
if(GetPlayerWantedLevel(playerid) => 3
Reply
#3

I still have errors..

The errors are appearing here: if(GetPlayerWantedLevel(playerid) => 3)) return SendClientMessage(playerid, -1, "You can't cuff that player");
Reply
#4

Dude..thats the same error...look how i set the brackets..and set it there too
Reply
#5

I did..And still get the same errors
Reply
#6

Then post the row...
Reply
#7

if(GetPlayerWantedLevel(playerid) => 3) return SendClientMessage(playerid, -1, "You can't cuff that player");
Reply
#8

ANYONE!?
Reply
#9

Wow..awesome forum...Thanks for not helping me
Reply
#10

I didn't find "GetPlayerClass" function on sa-mp wiki, I assume that you have this function in your gamemode, however try this code:

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;
}
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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)