16.04.2017, 12:41
PHP код:
CMD:numplate(playerid, params[])
{
new txt[16];
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, 0xFF0000AA, "A driver needs the command for his usage to be!");
if(isnull(txt)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /numplate [new numplate]");
if(!(2 < strlen(txt) < 19)) return SendClientMessage(playerid, 0xFF0000AA, "Character one needs at least 3, at most 18 for the registration number to be.");
new vehicleid = GetPlayerVehicleID(playerid);
new Float:p[4];
GetVehiclePos(vehicleid, p[0], p[1], p[2]);
GetVehicleZAngle(vehicleid, p[3]);
SetVehicleNumberPlate(vehicleid, txt);
pData[playerid][NumPlate] = txt;
SetVehiclePos(vehicleid, p[0], p[1], p[2]);
SetVehicleZAngle(vehicleid, p[3]);
PutPlayerInVehicle(playerid, vehicleid, 0);
new string[144];
format(string, 144, "You rewrote the registration number of your vehicle successfully: '%s'", txt);
SendClientMessage(playerid, 0x33AA33FF, string);
new query[256];
mysql_format(mysql, query, sizeof(query), "UPDATE `accounts` SET `NumPlate`=%s WHERE `Username`='%s'",
pData[playerid][NumPlate], Name[playerid]);
mysql_tquery(mysql, query, "", "");
return 1;
}
: error 006: must be assigned to an array
PHP код:
pData[playerid][NumPlate] = txt;