SA-MP Forums Archive
Problem with params sscanf2 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Problem with params sscanf2 (/showthread.php?tid=250910)



Problem with params sscanf2 - sMog. - 25.04.2011

Hello i have problem with params

PHP код:
CMD:drift(playeridparams[])
{
    if(
sscanf(params"d"params[0])) return SendClientMessage(playerid, -1"Usage: /drift <drift place> (1-53)");
    if(
params[0] < || params[0] > 53) return SendClientMessage(playeridCOLOR_YELLOW"ERROR: Invalid Drift place. It can be only from 1 to 53!");
    
PlayerGoesDrift(playeridDriftCoords[strval(params)-1][0], DriftCoords[strval(params)-1][1], DriftCoords[strval(params)-1][2], DriftCoords[strval(params)-1][3], DriftCoords[strval(params)-1][4]);
    return 
1;

if i type /drift 1 i get invalid command
if i type /drift i get Usage: /drift <drift place> (1-53)
if i type /drift 11 i goto drift 1
if i type /drift 12 i goto drift 2


Re: Problem with params sscanf2 - austin070 - 25.04.2011

pawn Код:
CMD:drift(playerid, params[])
{
    new place;
    if(sscanf(params, "d", place)) return SendClientMessage(playerid, -1, "Usage: /drift <drift place> (1-53)");
    if(place < 1 || place > 53) return SendClientMessage(playerid, COLOR_YELLOW, "ERROR: Invalid Drift place. It can be only from 1 to 53!");
    PlayerGoesDrift(playerid, DriftCoords[place-1][0], DriftCoords[place)-1][1], DriftCoords[place-1][2], DriftCoords[place-1][3], DriftCoords[place-1][4]);
    return 1;
}



Re: Problem with params sscanf2 - sMog. - 25.04.2011

thanks