08.05.2010, 06:14
Okay .. I am writing a property system, and this function creates a property ingame:
This is how it's used in the /createprop command:
When I try to compile it gives me this error:
What's wrong?
pawn Код:
stock CreateProperty(const name[], Float:X, Float:Y, Float:Z, Value, Earning)
{
PropCount++;
new ID = PropCount, string[128];
PropInfo[ID][PropExists] = 1;
format(PropInfo[ID][PropName], 60, "%s", name);
PropInfo[ID][PropX] = X;
PropInfo[ID][PropY] = Y;
PropInfo[ID][PropZ] = Z;
PropInfo[ID][PropValue] = Value;
PropInfo[ID][PropEarning] = Earning;
PropInfo[ID][PropOwner] = -1;
PropertyPickup[ID] = CreatePickup(1272, 1, X, Y, Z, -1);
SaveProperty(ID);
format(string, sizeof(string), "%s",PropInfo[ID][PropName]);
Dyna_3D = Create3DTextLabel(string,COLOR_BLUE,PropInfo[ID][PropX],PropInfo[ID][PropY],PropInfo[ID][PropZ]+0.6,40.0,0);
return ID;
}
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;
}
Код:
LSX.pwn(3181) : error 035: argument type mismatch (argument 1)