Need help with this
#1

im trying to make /kill command what adds 1 more death on /stats (death) you know.
PHP код:
CMD:kill(playerid,params[])
{
    
SetPlayerHealth(playerid0);
    
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 028invalid subscript (not an array or too many subscripts): "pDeaths"
C:\Users\asd\Desktop\samp03e_svr_R2_win32\pawno\test.pwn(356) : warning 215expression has no effect
C
:\Users\asd\Desktop\samp03e_svr_R2_win32\pawno\test.pwn(356) : error 001expected token";"but found "]"
C:\Users\asd\Desktop\samp03e_svr_R2_win32\pawno\test.pwn(356) : error 029invalid expressionassumed zero
C
:\Users\asd\Desktop\samp03e_svr_R2_win32\pawno\test.pwn(356) : fatal error 107too many error messages on one line 
Reply
#2

Код:
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, 
}
Reply
#3

Код:
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.
Reply
#4

PHP код:
PlayerInfo[playerid][pDeaths]++; 
// this was correct term btw thanks everyone!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)