im doing a WeaponLicense System and detected the first Problem (im using dini) he aint create a file (.ini) with my Name (Pepino960), hes creating a file without any names :/
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/BuyWeaponLicense", cmdtext, true, 10) == 0)
{
new name[MAX_PLAYER_NAME], string[128];
format(string, sizeof(string), "/WeaponLicense/%s.ini", name);
if(!dini_Exists(string))
{
if(GetPlayerMoney(playerid) < 6000)
{
SendClientMessage(playerid, -1, "You don't have enough money to buy a WeaponLicense!");
return 1;
}
else if(GetPlayerScore(playerid) < 500)
{
SendClientMessage(playerid, -1, "You need at least 500 Score to buy a WeaponLicense!");
return 1;
}
SendClientMessage(playerid, -1, "You have successfully bought a WeaponLicense! Be carefully with it!");
dini_Create(string);
GivePlayerMoney(playerid, -6000);
return 1;
}
SendClientMessage(playerid, -1, "You already bought a WeaponLicense.");
return 1;
}
return 0;
}