Vehicle Plates
#2

What version of MySQL are you using? Here's an example for R33 or higher.

PHP код:
CMD:checkplate(playeridparams[])
{
    new 
plate[128]; // MAX_PLATE_NUMBER
    
if (sscanf(params"s"plate)) return SendClientMessage(playerid, -1"USAGE: /checkplate (platenumber)");

    new 
query[128];
    
mysql_format(SQLquerysizeof(query), "SELECT `id` FROM `vehicles` WHERE `plate` = `%e`"plate);

    new 
Cache:result mysql_query(SQLquery);

    if (
cache_num_rows() > 0)
    {
        
// The plate number does exist
    
}
    else
    {
        
// It doesn't exist
    
}

    
cache_delete(result);

Reply


Messages In This Thread
Vehicle Plates - by ThatFag - 24.10.2016, 17:08
Re: Vehicle Plates - by Skimmer - 24.10.2016, 17:30
Re: Vehicle Plates - by ThatFag - 24.10.2016, 17:40
Re: Vehicle Plates - by Konstantinos - 24.10.2016, 17:44
Re: Vehicle Plates - by Skimmer - 24.10.2016, 17:50
Re: Vehicle Plates - by ThatFag - 24.10.2016, 18:32
Re: Vehicle Plates - by Skimmer - 24.10.2016, 18:35
Re: Vehicle Plates - by ThatFag - 24.10.2016, 18:59
Re: Vehicle Plates - by Konstantinos - 24.10.2016, 19:15
Re: Vehicle Plates - by ThatFag - 24.10.2016, 19:24

Forum Jump:


Users browsing this thread: 1 Guest(s)