22.10.2013, 13:44
Sorry for posting this again,but i have a bug with sscanf.
The main thing is that i'm scripting a taxi driver job,and when i do the fare cmd,it's buggy.
So the first time i fixed this bug,but now it's kinda half fixed.
The problem is when i type "/fare" it sends "USAGE: /fare [PRICE]",also when i type "/fare [and some int here]" it also prints "USAGE: /fare [PRICE]".I'm not sure what causes this.
The main thing is that i'm scripting a taxi driver job,and when i do the fare cmd,it's buggy.
So the first time i fixed this bug,but now it's kinda half fixed.
The problem is when i type "/fare" it sends "USAGE: /fare [PRICE]",also when i type "/fare [and some int here]" it also prints "USAGE: /fare [PRICE]".I'm not sure what causes this.
Code:
CMD:fare (playerid, params[]) { new price; new string[128]; new taxistName[MAX_PLAYER_NAME]; if (PlayerIsTaxiDriver[playerid]==1) { if (sscanf(params, "i", price)) return SendClientMessage(playerid, 0xFFF0F0, "USAGE : /fare [PRICE]"); GetPlayerName(playerid, taxistName, MAX_PLAYER_NAME); format (string, sizeof(string), "Taxi driver %s is now on duty.Fare: %i .", taxistName,price); SendClientMessageToAll(0xFFFFCC, string); } else if (PlayerIsTaxiDriver[playerid]==0) { SendClientMessage(playerid, CMD_ERROR, "You're not a taxi driver."); } return 1; }