if(strcmp(cmd, "/buycc", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pCreditCard] = 0); { SetPlayerInfo[playerid][pCreditCard] = 1; } else if { dini_IntSet(string3, "CreditCard",PlayerInfo[playerid][pCreditCard]); } } }
if(strcmp(cmd, "/buycc", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pCreditCard] == 0) //you need 2 == in if statements and don't use ; after a if
{
PlayerInfo[playerid][pCreditCard] = 1; // SetPlayerInfo is not a function i think
}
else //you had else if, else if wut? nothing so else
{
dini_IntSet(string3, "CreditCard",PlayerInfo[playerid][pCreditCard]);
}
}
}
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. |
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!");
}
}
}
for the most part yes.
but for whatever reason, it doesn't like the string3 error 017: undefined symbol "string3" |
C:\Users\Levis\Desktop\sampserver\gamemodes\larp.pwn(25157) : warning 219: local variable "string3" shadows a variable at a preceding level C:\Users\Levis\Desktop\sampserver\gamemodes\larp.pwn(25419) : warning 219: local variable "string3" shadows a variable at a preceding level C:\Users\Levis\Desktop\sampserver\gamemodes\larp.pwn(43813) : error 035: argument type mismatch (argument 1) C:\Users\Levis\Desktop\sampserver\gamemodes\larp.pwn(59706) : warning 219: local variable "string3" shadows a variable at a preceding level C:\Users\Levis\Desktop\sampserver\gamemodes\larp.pwn(83830) : warning 203: symbol is never used: "string3"
dini_IntSet(string3, "CreditCard",PlayerInfo[playerid][pCreditCard]); //change to PlayerInfo[playerid][pCreditCard] = 1;
FIXED!
I did as i stated above and it worked. It added the required line needed and didn't screw up the player file. Thanks for all of your help! ^_^ |