SA-MP Forums Archive
Could someone help? - 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: Could someone help? (/showthread.php?tid=541480)



Could someone help? - YanLanger - 12.10.2014

ok i did login register the one by Kush

Anyways it has kill deaths adminlevel and cash

But how could i add Score And it will save weapons?


Re: Could someone help? - YanLanger - 13.10.2014

bump


Re: Could someone help? - ThePhenix - 13.10.2014

Quote:
Originally Posted by YanLanger
Посмотреть сообщение
bump
At least provide us a part of the code.


Re: Could someone help? - YanLanger - 13.10.2014

But wich one? enums, register dialog, i can't know what code


Re: Could someone help? - GwENiko - 13.10.2014

His tutorial is very buggy. You can check the comments on the thread if you want.


Re: Could someone help? - YanLanger - 13.10.2014

na i fixed the bugs, I just need to know how to add that it saves score,weapons or something


Re: Could someone help? - GwENiko - 13.10.2014

Well here

pawn Код:
/* Add a variable for your score, for example pScore */
enum pInfo
{
pScore;
}
OnPlayerDisconnect

pawn Код:
public OnPlayerDisconnect
{
  INI_WriteInt(file, "pScore", variablename[playerid][pScore]);
   return 1;
}
pawn Код:
OnPlayerDeath(playerid, killerid, reason)
{
   
  variablename[playerid][pScore]++;
    return 1;
}
As for your weapons, create an array with the sufficient slots (13). Then loop through them and store them into an enum variable when the player logs out. Just give him weapons that were stored in the array when he returns. Which is exactly as above.


Re: Could someone help? - YanLanger - 13.10.2014

mhmm
i already have this things
PHP код:
INI_WriteInt(file"pScore"variablename[playerid][pScore]); 
here
PHP код:
forward LoadUser_data(playerid,name[],value[]);
public 
LoadUser_data(playerid,name[],value[])
{
    
INI_Int("Password",PlayerInfo[playerid][pPass]);
    
INI_Int("Cash",PlayerInfo[playerid][pCash]);
    
INI_Int("AdminLevel",PlayerInfo[playerid][pAdmin]);
    
INI_Int("Kills",PlayerInfo[playerid][pKills]);
    
INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
    return 
1;




Re: Could someone help? - YanLanger - 13.10.2014

Ah and
PHP код:
variablename[playerid][pScore]++; 
PHP код:
C:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(305) : error 017undefined symbol "variablename"
C:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(305) : warning 215expression has no effect
C
:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(305) : error 001expected token";"but found "]"
C:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(305) : error 029invalid expressionassumed zero
C
:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(305) : fatal error 107too many error messages on one line

Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase


4 Errors




Re: Could someone help? - Rudy_ - 13.10.2014

pawn Код:
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Password",PlayerInfo[playerid][pPass]);
    INI_Int("Score",PlayerInfo[playerid][pScore]);
    INI_Int("Cash",PlayerInfo[playerid][pCash]);
    INI_Int("AdminLevel",PlayerInfo[playerid][pAdmin]);
    INI_Int("Kills",PlayerInfo[playerid][pKills]);
    INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
    return 1;
}