SA-MP Forums Archive
GetPlayerWeapon isn't working. - 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: GetPlayerWeapon isn't working. (/showthread.php?tid=541336)



GetPlayerWeapon isn't working. - mkmk - 11.10.2014

I'm new to scripting, but I have an error code of " error 030: compound statement not closed at the end of file (started at line 525)" and I'm unable to fix it.

Код:
public OnPlayerCommandText(playerid, cmdtext[])

{
	if (strcmp("/SpawnM4", cmdtext, true, 10) == 0)
	{
		GivePlayerWeapon(playerid, 31, 10000);
		return 1;
}



Re: GetPlayerWeapon isn't working. - Rudy_ - 11.10.2014

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/SpawnM4", cmdtext, true, 10) == 0)
    {
        GivePlayerWeapon(playerid, 31, 10000);
    }
    return 1;
}
Edit: Get Zcmd much better
pawn Код:
CMD:spawnm4(playerid, params[]) //Add in bottom of the script, 'REMEMBER' Get Zcmd first, search in ******
{
    GivePlayerWeapon(playerid, 31, 10000);
    return 1;
}
And you don't need Bigger and lower case when making cmds , just make it /spawnm4 ...


Re: GetPlayerWeapon isn't working. - mkmk - 11.10.2014

Quote:
Originally Posted by Rudy_
Посмотреть сообщение
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/SpawnM4", cmdtext, true, 10) == 0)
    {
        GivePlayerWeapon(playerid, 31, 10000);
    }
    return 1;
}
Edit: Get Zcmd much better
pawn Код:
CMD:spawnm4(playerid, params[]) //Add in bottom of the script, 'REMEMBER' Get Zcmd first, search in ******
{
    GivePlayerWeapon(playerid, 31, 10000);
    return 1;
}
And you don't need Bigger and lower case when making cmds , just make it /spawnm4 ...
Never thought I'd see you here, Rudy >.>.

Also, thanks for the help, but I'm now approached with 5 'warnings'...


Re: GetPlayerWeapon isn't working. - Rudy_ - 11.10.2014

What warnings? show it.
And which script you used? Zcmd or strcmp?


Re: GetPlayerWeapon isn't working. - oskarunt - 11.10.2014

Can you post the warnings here? I'd be happy to help


Re: GetPlayerWeapon isn't working. - mkmk - 11.10.2014

Quote:
Originally Posted by Rudy_
Посмотреть сообщение
What warnings? show it.
And which script you used? Zcmd or strcmp?
strcmp, my whole script uses it so I don't think I should change it (the script is really... Quite long so...), fyi this is my first server and am just testing around with pawno.

: warning 203: symbol is never used: "thisanimid"
: warning 203: symbol is never used: "lastanimid"
: warning 203: symbol is never used: "gPoliceSpawns"
: warning 203: symbol is never used: "gMedicalSpawns"
: warning 203: symbol is never used: "gArmySpawns"


Re: GetPlayerWeapon isn't working. - oskarunt - 11.10.2014

These warnings are not related to this specific command.


Re: GetPlayerWeapon isn't working. - Rudy_ - 11.10.2014

Quote:
Originally Posted by mkmk
Посмотреть сообщение
strcmp, my whole script uses it so I don't think I should change it (the script is really... Quite long so...), fyi this is my first server and am just testing around with pawno.

: warning 203: symbol is never used: "thisanimid"
: warning 203: symbol is never used: "lastanimid"
: warning 203: symbol is never used: "gPoliceSpawns"
: warning 203: symbol is never used: "gMedicalSpawns"
: warning 203: symbol is never used: "gArmySpawns"
Search for them and remove these lines, they are not needed.


Re: GetPlayerWeapon isn't working. - mkmk - 11.10.2014

These warnings only appear when I script in the command.


Re: GetPlayerWeapon isn't working. - Beckett - 11.10.2014

Quote:
Originally Posted by mkmk
Посмотреть сообщение
Never thought I'd see you here, Rudy >.>.
That Rudy above isn't Rudy the Croatian one.



: - ) D4rko : - )

On topic:
Warning above aren't related to the code you've provided remove them you are not using them, it's simply saying that the variable above isn't being used.

Use [pawn] [ / pawn] code.