SA-MP Forums Archive
Help attach object with else - 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: Help attach object with else (/showthread.php?tid=511657)



Help attach object with else - GrOobY - 06.05.2014

Код HTML:
COMMAND:bandana(playerid, params[]) // or CMD:mycommand(playerid, params[])
{
SetPlayerAttachedObject(playerid, 0, 18912, 2, 0.078534, 0.041857, -0.001727, 268.970458, 1.533374, 269.223754);
SendClientMessage(playerid, COLOR_GREEN, "Repeat command to remove object");
}
else
{
RemovePlayerAttachedObject(0);
}
return 1;
}
Error

C:\Users\Digital\Documents\samp\filterscripts\band an.pwn(139) : error 010: invalid function or declaration
C:\Users\Digital\Documents\samp\filterscripts\band an.pwn(143) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.

Line 139 its else
143 its return 1;


Re: Help attach object with else - David (Sabljak) - 06.05.2014

Код:
COMMAND:bandana(playerid, params[]) // or CMD:mycommand(playerid, params[])
{
SetPlayerAttachedObject(playerid, 0, 18912, 2, 0.078534, 0.041857, -0.001727, 268.970458, 1.533374, 269.223754);
SendClientMessage(playerid, COLOR_GREEN, "Repeat command to remove object");
else
{
RemovePlayerAttachedObject(0);
}
return 1;
}
Код:
{

}
learn that { }


Re: Help attach object with else - GrOobY - 06.05.2014

still not working

C:\Users\Digital\Documents\samp\filterscripts\band an.pwn(13 : error 029: invalid expression, assumed zero
C:\Users\Digital\Documents\samp\filterscripts\band an.pwn(140) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Line 138: else
Line 140: RemovePlayerAttachedObject(0);


Re: Help attach object with else - mrtms - 06.05.2014

PHP код:
new Bandana[MAX_PLAYERS];

COMMAND:bandana(playeridparams[]) // or CMD:mycommand(playerid, params[])
{
    if(
Bandana[playerid] == 0)
    {
        
SetPlayerAttachedObject(playerid01891220.0785340.041857, -0.001727268.9704581.533374269.223754);
        
SendClientMessage(playeridCOLOR_GREEN"Repeat command to deattach object");
        
Bandana[playerid] = 1;
    }
    else
    {
        
RemovePlayerAttachedObject(0);
        
SendClientMessage(playeridCOLOR_GREEN"Repeat command to attach object");
        
Bandana[playerid] = 0;
    }
    return 
1;




Re: Help attach object with else - GrOobY - 06.05.2014

C:\Users\Digital\Documents\samp\filterscripts\band an.pwn(145) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.


line 145 its RemovePlayerAttachedObject(0);


Re: Help attach object with else - gekas - 06.05.2014

PHP код:
RemovePlayerAttachedObject(playerid0); 
Try this if doesent work tell mee


Re: Help attach object with else - GrOobY - 06.05.2014

Works gekas thnx now i will try the script