Some errors. - 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: Some errors. (
/showthread.php?tid=660166)
Some errors. -
ZigGamerx - 26.10.2018
Код:
PlayerKillScore(playerid, killerid)
{
if (IsDsEnabled == 1)
{
new stri[128];
format(stri, sizeof(stri), ""COL_YELLOW"**Double Score: "COL_RED"You earned +2 Extra Score."PlayerInfo[playerid]);
SCM(killerid, -1, stri);
SetPlayerScore(killerid, GetPlayerScore(killerid) +2);
}
else
{
SetPlayerScore(killerid, GetPlayerScore(killerid) +2);
}
return 1;
}
Код:
G:\Pawno\MW3SAMP-master\gamemodes\CODMW3.pwn(17306) : error 001: expected token: "-string end-", but found "-identifier-"
G:\Pawno\MW3SAMP-master\gamemodes\CODMW3.pwn(17306) : warning 215: expression has no effect
G:\Pawno\MW3SAMP-master\gamemodes\CODMW3.pwn(17306) : error 001: expected token: ";", but found ")"
G:\Pawno\MW3SAMP-master\gamemodes\CODMW3.pwn(17306) : error 029: invalid expression, assumed zero
G:\Pawno\MW3SAMP-master\gamemodes\CODMW3.pwn(17306) : fatal error 107: too many error messages on one line
ERROR LINE : format(stri, sizeof(stri), ""COL_YELLOW"**Double Score: "COL_RED"You earned +2 Extra Score."PlayerInfo[playerid]);
Re: Some errors. -
KinderClans - 26.10.2018
pawn Код:
PlayerKillScore(playerid, killerid)
{
if (IsDsEnabled == 1)
{
new stri[128];
format(stri, sizeof(stri), ""COL_YELLOW"**Double Score: "COL_RED"You earned +2 Extra Score.", PlayerInfo[playerid]);
SCM(killerid, -1, stri), SetPlayerScore(killerid, GetPlayerScore(killerid) +2);
}
else SetPlayerScore(killerid, GetPlayerScore(killerid) +2);
return 1;
}
You were missing a
, at double score message.
Re: Some errors. -
ZigGamerx - 26.10.2018
omg i must repair my eyes xD +REP
Re: Some errors. -
GTLS - 27.10.2018
Wait, where in your line, have you used PlayerInfo[playerid]'s value?
This:
Код:
format(stri, sizeof(stri), ""COL_YELLOW"**Double Score: "COL_RED"You earned +2 Extra Score.", PlayerInfo[playerid]);
Should be
Код:
format(stri, sizeof(stri), "%s"COL_YELLOW"**Double Score: "COL_RED"You earned +2 Extra Score.", PlayerInfo[playerid]); //use %s for string, where ever you want to display the value. Otherwise, using PlayerInfo[playerid] is useless.
And second, are you sure PlayerInfo[playerid] is the end of the variable?