24.02.2011, 12:21
Quote:
You're right about the SetPlayerInfo. lol.
for the else if, some players do will not have [pCreditCard] in their .ini file so i need to somehow add it if they do not have it. |
you better use when a player registers add this:
dini_IntSet(string3, "CreditCard",0); //(i dunno what string3 is, probly username?)
pawn Код:
if(strcmp(cmd, "/buycc", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pCreditCard] == 0) //If the player has not a credit card
{
PlayerInfo[playerid][pCreditCard] = 1; // Set a creditcard
dini_IntSet(string3, "CreditCard",PlayerInfo[playerid][pCreditCard]); // Better save it after buying
}
else if(PlayerInfo[playerid][pCreditCard] == 1)// If the player Has a credit card
{
SendClientMessage(playerid,COLOR_RED,"ERROR: You already have a CC!");
}
}
}