Need help with this - 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: Need help with this (
/showthread.php?tid=386043)
Need help with this -
Majava - 18.10.2012
im trying to make /kill command what adds 1 more death on /stats (death) you know.
PHP код:
CMD:kill(playerid,params[])
{
SetPlayerHealth(playerid, 0);
SendClientMessage(playerid,COLOR_RED,"You have commited suicide!");
pDeaths[pInfo] = ++;
return 1;
}
I have stat saving system
PHP код:
enum pInfo
{
pPass,
pCash,
pAdmin,
pKills,
pDeaths
}
I got these errors:
PHP код:
C:\Users\asd\Desktop\samp03e_svr_R2_win32\pawno\test.pwn(356) : error 028: invalid subscript (not an array or too many subscripts): "pDeaths"
C:\Users\asd\Desktop\samp03e_svr_R2_win32\pawno\test.pwn(356) : warning 215: expression has no effect
C:\Users\asd\Desktop\samp03e_svr_R2_win32\pawno\test.pwn(356) : error 001: expected token: ";", but found "]"
C:\Users\asd\Desktop\samp03e_svr_R2_win32\pawno\test.pwn(356) : error 029: invalid expression, assumed zero
C:\Users\asd\Desktop\samp03e_svr_R2_win32\pawno\test.pwn(356) : fatal error 107: too many error messages on one line
Re: Need help with this -
Shockey HD - 18.10.2012
Код:
CMD:kill(playerid,params[])
{
SetPlayerHealth(playerid, 0);
SendClientMessage(playerid,COLOR_RED,"You have commited suicide!");
pDeaths[pInfo]++;
return 1;
}
Код:
enum pInfo
{
pPass,
pCash,
pAdmin,
pKills,
pDeaths,
}
Re : Need help with this -
lelemaster - 18.10.2012
Код:
CMD:kill(playerid,params[])
{
SetPlayerHealth(playerid, 0);
SendClientMessage(playerid,COLOR_RED,"You have commited suicide!");
pDeaths[playerid][pInfo]++; // You forgot something here
return 1;
}
@Shockey HD, you don't need a comma after pDeaths.
Re: Need help with this -
Majava - 18.10.2012
PHP код:
PlayerInfo[playerid][pDeaths]++;
// this was correct term btw thanks everyone!