12.01.2017, 12:44
Well hello again!
My server crash sometimes when a user do the command /vipname.
Also , i can't make a query to load the vipnameinf OnPlayerLogin . :/
Using MySQL R34.
My server crash sometimes when a user do the command /vipname.
PHP код:
CMD:vipname(playerid, params[])
{
new text[6], szMessage[256];
new vehicleid = GetPlayerVehicleID(playerid);
if(sscanf(params, "s[50]", text)) return SCM(playerid, COLOR_WHITE, "SYNTAX: /vipname [name]");
if(PlayerInfo[playerid][pPremiumAccount] != 1) return SCM(playerid, COLOR_ERROR, "You don't have a premium account");
{
if(vText[playerid] != -1) return SCM(playerid, COLOR_WHITE, "Use first /removename to put another name on your car.");
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SCM(playerid, COLOR_WHITE, "You aren't in any car.");
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SCM(playerid, COLOR_ERROR, "You aren't the driver.");
if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 411) return SCM(playerid, COLOR_ERROR, "Car must be an Infernus in order to apply this command.");
if(OwnedVeh(vehicleid))
{
vText[playerid] = CreateObject(19327, -2597.0762, -2638.4270, -5.3536, -87.6999, 90.4001, -87.1805);
SetObjectMaterialText(vText[playerid] , text, 0, 50, "Arial", 15, 1, 0xFFFFFFFF, 0, 1);
AttachObjectToVehicle(vText[playerid] , vehicleid, 0.0,-1.9, 0.3, 270.0, 0.0, 0.0);
format(szMessage, sizeof(szMessage), "{F2CF09}Vipname is: '%s'", text);
SCM(playerid, COLOR_YELLOW, szMessage);
new var[64];
mysql_format(SQL, var, sizeof(var),"UPDATE `users` SET `vipnameinf`='%s' WHERE `name`='%d'", text, PlayerInfo[playerid][pNormalName]);
mysql_tquery(SQL, var,"","");
}
}
return 1;
}
Using MySQL R34.