Weapon License
#1

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;
}
Reply
#2

pawn Код:
new name[24];
GetPlayerName(playerid, name, 24);
Reply
#3

Ohhh yeah, i knew ive forgotten something:/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)