Message problem...
#1

Please help me with this:

pawn Код:
cmd(fare, playerid, params[])
{
  if(IsPlayerConnected(playerid) && PlayerLoggedIn[playerid])
  {
    new fare;
    new string[128];
    new vehicle = GetPlayerVehicleID(playerid);
    if(PlayerInfo[playerid][pJob] == 3)
    {
       if(IsTaxiCar(vehicle))
       {
         if(sscanf(params, "d",fare))
         {
           SendClientMessage(playerid, COLOR_HELP, "USAGE: /fare <amount>");
           return 1;
         }
         if(fare < 10 || fare > 30)
         {
           SendClientMessage(playerid,COLOR_ERROR,"ERROR: The fare can't be less than $10 or higher than $30.");
           return 1;
         }
         TransportValue[playerid] = fare;
         format(string, strlen(string),"You have set your fare to %d$.",TransportValue[playerid]);
         SendClientMessage(playerid,COLOR_INFO,string);
       }
     }
   }
   return 1;
}
The problem is that the message You have set your fare to %d$. doesn't show up, it only displays a blank message with no text.

Please help me, thank you...
Reply
#2

Try making the %d to %i
Reply
#3

Umm, it didn't help.. but thanks for trying.
Reply
#4

alo pomagajte mu treba mu hitno biti ce љamaranja jeste culi?
Reply
#5

Quote:
Originally Posted by KuraCCCCC
alo pomagajte mu treba mu hitno biti ce љamaranja jeste culi?
What ?
Reply
#6

Check your include files ...
Reply
#7

Quote:
Originally Posted by Xoop
Umm, it didn't help.. but thanks for trying.
try %s :P
as thats for strings.
Reply
#8

Quote:
Originally Posted by laser50
Quote:
Originally Posted by Xoop
Umm, it didn't help.. but thanks for trying.
try %s :P
as thats for strings.
Im not puting in a string, im puting in an integer so it's %d or %i but neither of them work.
Reply
#9

Код:
format(string, sizeof(string),"You have set your fare to %d$.",TransportValue[playerid]);
Reply
#10

Thank you, it works.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)