SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 01/06/2020, 07:54 AM   #1
HK
Big Clucker
 
Join Date: Nov 2013
Posts: 172
Reputation: 16
Thumbs up Help.

Hello.

I'm trying to create a /v get command for my server.

Code:
new slotid;

		if(sscanf(b_string, "get", slotid)) {
			return SendClientMessage(playerid, COLOR_ADM, "USAGE:{FFFFFF} /v(ehicle) get [vehicle slot ID]");

		if(slotid > MAX_OWNED_CARS || slotid < 1)
			return SendClientMessage(playerid, COLOR_ADM, "SERVER: Invalid Slot.");

		if(!PlayerData[playerid][pOwnedCar][slotid])
			return SendClientMessage(playerid, COLOR_ADM, "ERROR: You don't have a vehicle in that slot.");

		if(_has_vehicle_spawned[playerid])
			return SendClientMessage(playerid, COLOR_ADM, "SERVER: You already have a vehicle spawned.");

		LoadOwnedCars(playerid, slotid);
		return 1;

But this only will return it to the end code:

Code:
	}
	else return SendClientMessage(playerid, COLOR_ADM, "SERVER: Invalid Parameter.");
	return true;
}
Anyone can help me find what's off the with the code?
HK is offline   Reply With Quote
Old 01/06/2020, 09:04 AM   #2
Kwarde
High-roller
 
Kwarde's Avatar
 
Join Date: Nov 2009
Location: The Netherlands
Posts: 2,713
Reputation: 1671
Default Re: Help.

That is now how sscanf works.
g = IEEE Float
e = MySQL escape specifier, however that only works in mysql_format() and not in sscanf
t = As far as I know, no specifier at all.

Check this out https://forum.sa-mp.com/showthread.php?t=570927
__________________
When the opportunity presents itself to flip-a da table, uh, you flip-a da table.

Discord: Kwarde#8009
Kwarde is online now   Reply With Quote
Old 01/06/2020, 09:57 AM   #3
HK
Big Clucker
 
Join Date: Nov 2013
Posts: 172
Reputation: 16
Default Re: Help.

Quote:
Originally Posted by Kwarde View Post
That is now how sscanf works.
g = IEEE Float
e = MySQL escape specifier, however that only works in mysql_format() and not in sscanf
t = As far as I know, no specifier at all.

Check this out https://forum.sa-mp.com/showthread.php?t=570927
Hello, thanks! Works now!
HK is offline   Reply With Quote
Old 01/06/2020, 08:01 PM   #4
[FMJ]PowerSurge
Big Clucker
 
Join Date: May 2012
Location: Nottingham, England
Posts: 125
Reputation: 19
Default Re: Help.

Quote:
Originally Posted by Kwarde View Post
That is now how sscanf works.
g = IEEE Float
e = MySQL escape specifier, however that only works in mysql_format() and not in sscanf
t = As far as I know, no specifier at all.

Check this out https://forum.sa-mp.com/showthread.php?t=570927
If you weren't aware, 'e' in sscanf2 is now enum.

pawn Code:
enum
    E_DATA
{
    E_DATA_C,
    Float:E_DATA_X,
    E_DATA_NAME[32],
    E_DATA_Z
}

main
{
    new
        var[E_DATA];
    sscanf("1 12.0 Bob c", "e<ifs[32]c>", var);
}
[FMJ]PowerSurge is offline   Reply With Quote
Old 01/06/2020, 09:00 PM   #5
Kwarde
High-roller
 
Kwarde's Avatar
 
Join Date: Nov 2009
Location: The Netherlands
Posts: 2,713
Reputation: 1671
Default Re: Help.

Ah yes, ofc, that is right. Totally forgot that!
__________________
When the opportunity presents itself to flip-a da table, uh, you flip-a da table.

Discord: Kwarde#8009
Kwarde is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 03:49 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.