23.02.2013, 19:50
I have this error that I keep getting and I have no idea why I'm getting it and I have no idea how to fix it.
Here is the code:
The error is pointing to this line: PlayerInfo[playerid][pReferedBy] = playername;
PHP код:
Line (13643) : error 006: must be assigned to an array
PHP код:
COMMAND:referr(playerid, params[])
{
new playername[24], string[100];
if(!PlayerInfo[playerid][pReferedBy]) return SendClientMessage(playerid, COLOR_GRAD3, "You have already previously referred somebody.");
if(sscanf(params, "s[24]", playername)) return Usage(playerid, "/referr [playername]");
//Pull MySQL information from the SQL database
format(string, sizeof(string), "SELECT `Name` FROM `users` WHERE `Name`='%s'", playername);
mysql_query(string);
mysql_store_result();
if(!mysql_num_rows()) return SendClientMessage(playerid, COLOR_GRAD3, "The players name you provided is not an existing players name.");
if(accountID[playerid] == GetOfflinePlayerInt(playername, "accountid")) return SendClientMessage(playerid, COLOR_GRAD3, "You cannot another one of your characters.");
if(PlayerInfo[playerid][pIP] == GetOfflinePlayerInt(playername, "ip")) return SendClientMessage(playerid, COLOR_GRAD3, "You cannot referr somebody with the same IP Address.");
mysql_free_result();
//Referral system
PlayerInfo[playerid][pReferedBy] = playername;
return 1;
}