Samp Object help
#1

Code:
if (strcmp("/parrot", cmdtext, true, 10) == 0)
	{
		SetPlayerAttachedObject(playerid,1, 19079, 1, 0.319503, -0.089340, -0.185576, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 );
		SendClientMessage(playerid, COLOR_RED, "You've Have gave urself an parrot");
		return 1;

	}
how i make it where i type /parrot the second time and it removes it and the next time i can put it on again
Reply
#2

Problem in anticheat.
Reply
#3

you mean this ?

pawn Code:
new bool:parrot[MAX_PLAYERS];




if (strcmp("/parrot", cmdtext, true, 10) == 0)
{
    if(parrot[playerid] == false)
    {
        SetPlayerAttachedObject(playerid,1, 19079, 1, 0.319503, -0.089340, -0.185576, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 );
        SendClientMessage(playerid, COLOR_RED, "You've Have gave urself an parrot");
                parrot[playerid] == true;
    }
    else if(parrot[playerid] == true)
    {
        if(IsPlayerAttachedObjectSlotUsed(playerid, 1)) RemovePlayerAttachedObject(playerid,1);
        SendClientMessage(playerid, COLOR_RED, "You removed your parrot");
                parrot[playerid] == false;
    }
    return 1;
}
put
pawn Code:
new bool:parrot[MAX_PLAYERS];
top of your code ..
Reply
#4

C:\Users\Debbie\Documents\Scripting\gamemodes\ls-dm.pwn(727) : warning 215: expression has no effect
C:\Users\Debbie\Documents\Scripting\gamemodes\ls-dm.pwn(734) : warning 215: expression has no effect


2 warnings

the warnings are these parrot[playerid] == false; and parrot[playerid] == true;

and the thing dont work it still dont take away the parrot i added it like this it still adds the parrot and dont take away

Code:
	new bool:parrot[MAX_PLAYERS];
 	if (strcmp("/parrot", cmdtext, true, 10) == 0)
{
    if(parrot[playerid] == false)
    {
        SetPlayerAttachedObject(playerid,0, 19079, 1, 0.319503, -0.089340, -0.185576, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 );
        SendClientMessage(playerid, COLOR_RED, "You've Have gave urself an parrot");
                parrot[playerid] == true;

    }
    else if(parrot[playerid] == true)
    {
        if(IsPlayerAttachedObjectSlotUsed(playerid, 0)) RemovePlayerAttachedObject(playerid,0);
        SendClientMessage(playerid, COLOR_RED, "You removed your parrot");
                parrot[playerid] == false;
    }
    	return 1;

	}
Reply
#5

up sorry ..

change parrot[playerid] == true;
and parrot[playerid] == false;

to parrot[playerid] = true;
and parrot[playerid] = false;

and PUT the new boolarrot[MAX_PLAYERS]; At top of your script not at top of onplayercommandtext ..
Reply
#6

DELEtE.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)