Can't use spaces in property name?!
#1

I have this command for creating a property ingame:

pawn Код:
CMD:createprop(playerid, params[])
{
    if(PlayerInfo[playerid][Level] >= 4)
    {
      new Propnick, Float:X, Float:Y, Float:Z, Value, Earning, string[128];
      GetPlayerPos(playerid, X, Y, Z);
      if(sscanf(params, "s[64]dd", Propnick, Value, Earning)) return SendClientMessage(playerid, Red, "USAGE: /createprop [Name] [Cost] [Earning]");
      CreateProperty(Propnick, X, Y, Z, Value, Earning); // Line 3181
      format(string, sizeof(string), "* Successfully created the property %s", Propnick);
      SendClientMessage(playerid, MAD_WHITE, string);
      return 1;
    } else return 0;
}
The function "CreateProperty" also creates a 3DTextLabel for the property for information purposes. However, when creating the property .. I can't use spaces in the name? Why not? I mean .. I see the problem .. with sscanf, but how do I solve it?

How do I make it so you can use spaces in the name.
Reply
#2

You have to set string as last.
Like this « /createprop [cost] [earning] [name] »
Reply
#3

Quote:
Originally Posted by » RyDeR «
You have to set string as last.
Like this « /createprop [cost] [earning] [name] »
Thanks so much !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)