Help Please :) - 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 Please :) (
/showthread.php?tid=281184)
Help Please :) -
lordturhan - 04.09.2011
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/test", cmdtext, true, 10) == 0)
{
GetPlayerHealth(playerid 100)
SetPlayerArmour(playerid 100)
return 1;
}
return 0;
}
When i do this on a normal start it gives warning:
Код:
(93) : error 001: expected token: ",", but found "-integer value-"
(93) : warning 215: expression has no effect
(93) : error 001: expected token: ";", but found ")"
(93) : error 029: invalid expression, assumed zero
(93) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
İm new to this i just started today and im trying to do my best to become filterscripter
Re: Help Please :) -
TheLazySloth - 04.09.2011
This:
GetPlayerHealth(playerid 100)
SetPlayerArmour(playerid 100)
Should be:
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
Re: Help Please :) -
=WoR=Varth - 04.09.2011
https://sampwiki.blast.hk/wiki/GetPlayerHealth
https://sampwiki.blast.hk/wiki/SetPlayerArmour
https://sampforum.blast.hk/showthread.php?tid=199796
Re: Help Please :) -
[MWR]Blood - 04.09.2011
Filterscripter? Maybe you meant scripter.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/test", cmdtext, true, 10) == 0)
{
GetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
return 1;
}
return 0;
}
You were missing some commas and the ;.
I added them for you, it should compile just fine now.
Re: Help Please :) -
=WoR=Varth - 04.09.2011
Quote:
Originally Posted by [MWR]Blood
Filterscripter? Maybe you meant scripter.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]) { [I][B][SIZE="4"]if (strcmp("/test", cmdtext, true, 5) == 0)[/SIZE][/B][/I]//And it 5 "/test" { [B][U][SIZE="4"]GetPlayerHealth(playerid, 100);[/SIZE][/U][/B]//Wtf is this?? SetPlayerArmour(playerid, 100); return 1; } return 0; }
You were missing some commas and the ;.
I added them for you, it should compile just fine now.
|
It's should be "Set".
Re: Help Please :) -
lordturhan - 04.09.2011
Thanks all i will try it and i hope it will work.
And im new around here so dont know the terms etc.
Re: Help Please :) -
TheLazySloth - 04.09.2011
Quote:
Originally Posted by [MWR]Blood
Filterscripter? Maybe you meant scripter.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/test", cmdtext, true, 10) == 0) { GetPlayerHealth(playerid, 100); SetPlayerArmour(playerid, 100); return 1; } return 0; }
You were missing some commas and the ;.
I added them for you, it should compile just fine now.
|
Get should also be Set...
Unless you were trying to do,
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/test", cmdtext, true, 10) == 0)
{
new Float: PHp;
GetPlayerHealth(playerid, PHp);
SetPlayerArmour(playerid, PHp);
return 1;
}
return 0;
}
Re: Help Please :) -
[MWR]Blood - 04.09.2011
Quote:
Originally Posted by varthshenon
It's should be "Set".
|
Oh, indeed.
Sorry, my fault, didn't see that.
Re: Help Please :) -
=WoR=Varth - 04.09.2011
Quote:
Originally Posted by lordturhan
Thanks all i will try it and i hope it will work.
And im new around here so dont know the terms etc.
|
Quote:
Originally Posted by varthshenon
|
Read them and you shouldn't lost.
Re: Help Please :) -
lordturhan - 04.09.2011
Quote:
Originally Posted by varthshenon
Read them and you shouldn't lost.
|
İ did but still i couldnt do it
İ will try to add this code to lvdm.