GetPlayerWeapon isn't working.
#1

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;
}
Reply
#2

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 ...
Reply
#3

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'...
Reply
#4

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

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

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"
Reply
#7

These warnings are not related to this specific command.
Reply
#8

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.
Reply
#9

These warnings only appear when I script in the command.
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)