Problem with params sscanf2
#1

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
Reply
#2

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;
}
Reply
#3

thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)