22.08.2018, 09:46
PHP код:
CMD:creategang(playerid, params[])
{
new gName[100], string[150], query[250];
if(pInfo[playerid][GangID] == 1) return SendClientMessage(playerid, COLOR_YELLOW, "(gang) You can't make a gang since you already are in a gang");
if(sscanf(params, "s[100]", gName)) return SendClientMessage(playerid, COLOR_YELLOW, "(gang) Syntax: /creategang (gang name)");
if(CheckGangByName(gName)) return SendClientMessage(playerid, COLOR_YELLOW, "(gang) A gang with this name is already taken");
mysql_format(g_SQL, query, sizeof query, "INSERT INTO `gangs` (GangID, GangName, GangOwner) VALUES (NULL, '%e', '%e') LIMIT 1", gName, PlayerName[playerid]);
mysql_tquery(g_SQL, query);
pInfo[playerid][NameGang] = gName;
pInfo[playerid][OwnerGang] = PlayerName;
format(string, sizeof(string), "You created: '%s'", gName);
SendClientMessage(playerid, -1, string);
pInfo[playerid][GangID] = 1;
mysql_format(g_SQL, query, sizeof query, "UPDATE `players` SET `idgang` = '1' WHERE `id` = '%d' LIMIT 1", pInfo[playerid][ID]);
mysql_tquery(g_SQL, query);
return 1;
}
PHP код:
C:\Users\fomina.janett1919\Desktop\gtadm\gamemodes\gtadm.pwn(4256) : error 006: must be assigned to an array
C:\Users\fomina.janett1919\Desktop\gtadm\gamemodes\gtadm.pwn(4257) : error 006: must be assigned to an array
PHP код:
pInfo[playerid][NameGang] = gName;
pInfo[playerid][OwnerGang] = PlayerName;