20.07.2014, 20:47
So, I've got this little thing:
And I used it on registration:
However, it doesn't save in the enum. And if the person relogs, he'll get 0 $.
I did have it in the OnPlayerSpawn for a while, and then I noticed that the player gets new 5000$ over and over again, whenever he respawns.
Код:
stock GivePlayerCash(playerid, money)
{
PlayerInfo[playerid][pCash] += money;
ResetMoneyBar(playerid);//Resets the money in the original moneybar, Do not remove!
UpdateMoneyBar(playerid,PlayerInfo[playerid][pCash]);//Sets the money in the moneybar to the serverside cash, Do not remove!
return PlayerInfo[playerid][pCash];
}
Код:
if(dialogid == DIALOG_GENDER)
{
if(response) // Ako uprve prvo
{
if(listitem == 0) // Ako oće da je muљko
{
PlayerInfo[playerid][pSex] = MALE;
SendClientMessage(playerid, -1,""COL_LIGHTBLUE"Mozete krenuti sa igranjem. Ukoliko imate pitanja, kontaktirajte admina putem komande /newchat, ili koristite komandu /help. Ugodno igranje.");
SpawnPlayer(playerid);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
GivePlayerCash(playerid, 5000);
}
if(listitem == 1) // Ako oće da je ћensko
{
PlayerInfo[playerid][pSex] = FEMALE;
SendClientMessage(playerid, -1,""COL_LIGHTBLUE"Mozete krenuti sa igranjem. Ukoliko imate pitanja, kontaktirajte admina putem komande /newchat, ili koristite komandu /help. Ugodno igranje.");
SpawnPlayer(playerid);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
GivePlayerCash(playerid, 5000);
}
}
}
I did have it in the OnPlayerSpawn for a while, and then I noticed that the player gets new 5000$ over and over again, whenever he respawns.


i saw some hosts had some problems with permission 777 so thats why i asked i got no idea why this happens to u i hope it get's fixed.