Helmet problem
#1

im writing /helmet the helmets goes on head..but i cant make it come off if i type /helmet again..

Код:
if(strcmp(cmd, "/helmet",true) == 0) {
		SetPlayerAttachedObject(playerid,3 , 18645, 2, 0.07, 0.017, 0, 88, 75, 0);
		return 1;
		}
PS:i want to write /helmet to put helmet on if i type again helmet then the helmet goes off pleasee help Romanian!
Reply
#2

To remove attached object, you have to use the RemovePlayerAttachedObject() function, calling again SetPlayerAttachedObject() won't work.

pawn Код:
if (strcmp(cmd, "/helmet", true) == 0) {
    if (IsPlayerAttachedObjectSlotUsed(playerid, 3))
        RemovePlayerAttachedObject(playerid, 3);
    else
        SetPlayerAttachedObject(playerid, 3, 18645, 2, 0.07, 0.017, 0, 88, 75, 0);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)