01.03.2016, 02:11
El siguiente codigo me da errores.
Definicion de las funciones:
pawn Код:
CMD:v(playerid,params[])
{
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_RED,"Ya tienes un vehiculo. Baja e intenta de nuevo.");
new id;
new vehiculo;
if(sscanf(params,"i",id)) return SendClientMessage(playerid,COLOR_RED,"USO: /v [Nombre del vehiculo o ID");
if(!IsNumeric(id))
{
vehiculo = GetVehicleModelIDFromName(id);
}
return 1;
}
pawn Код:
error 035: argument type mismatch (argument 1)
error 035: argument type mismatch (argument 1)
pawn Код:
stock GetVehicleModelIDFromName(vname[])
{
for(new i = 0; i < 211; i++)
{
if ( strfind(VehicleNames[i], vname, true) != -1 )
return i + 400;
}
return -1;
}
IsNumeric(const string[])
{
for (new i = 0, j = strlen(string); i < j; i++)
{
if (string[i] > '9' || string[i] < '0') return 0;
}
return 1;
}