Plate Number
#4

Alright thanks, But any idea whats wrong with this command cuz every time i use this command it respawn my vehicle but doesn't change my vehicle plate number.

PHP код:
CMD:numplate(playeridparams[])
{
    new 
txt[16];
    if(
GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid0xFF0000AA"A driver needs the command for his usage to be!");
    if(
isnull(txt)) return SendClientMessage(playerid0xFF0000AA"Usage: /numplate [new numplate]");
    if(!(
strlen(txt) < 19)) return SendClientMessage(playerid0xFF0000AA"Character one needs at least 3, at most 18 for the registration number to be.");
    new 
vehicleid GetPlayerVehicleID(playerid);
    new 
Float:p[4];
    
GetVehiclePos(vehicleidp[0], p[1], p[2]);
    
GetVehicleZAngle(vehicleidp[3]);
    
SetVehicleNumberPlate(vehicleidtxt);
    
format(pData[playerid][NumPlate],16,"%s",txt);
    
SetVehicleToRespawn(vehicleid);
    
SetVehiclePos(vehicleidp[0], p[1], p[2]);
    
SetVehicleZAngle(vehicleidp[3]);
    
PutPlayerInVehicle(playeridvehicleid0);
    new 
string[144];
    
format(string144"You rewrote the registration number of your vehicle successfully: '%s'"txt);
    
SendClientMessage(playerid0x33AA33FFstring);
    new 
query[256];
    
mysql_format(mysqlquerysizeof(query), "UPDATE `accounts` SET `NumPlate`=%s WHERE `Username`='%s'",
    
pData[playerid][NumPlate], Name[playerid]);
    
mysql_tquery(mysqlquery"""");
    return 
1;

EDIT:

So, i found out i am doing something wrong on mysql.
Is this wrong way to save num plate ?

PHP код:
new query[256];
    
mysql_format(mysqlquerysizeof(query), "UPDATE `accounts` SET `NumPlate`=%s WHERE `Username`='%s'",
    
pData[playerid][NumPlate], Name[playerid]);
    
mysql_tquery(mysqlquery""""); 
Reply


Messages In This Thread
Plate Number - by sscarface - 16.04.2017, 12:41
Re: Plate Number - by DarkSkull - 16.04.2017, 12:46
Re: Plate Number - by GangstaSunny. - 16.04.2017, 13:07
Re: Plate Number - by sscarface - 16.04.2017, 17:21
Re: Plate Number - by sscarface - 16.04.2017, 17:31
Re: Plate Number - by DarkSkull - 16.04.2017, 17:53

Forum Jump:


Users browsing this thread: 1 Guest(s)