Errors Help
#1

Hey first off this has recently been posted on the Script Request thread as a reply but i thought i might as well put it here to

pawn Код:
error 017: undefined symbol "model"
 error 017: undefined symbol "string"
 error 017: undefined symbol "string"
 error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line

pawn Код:
CMD:spawnveh(playerid, params[])
{
    new modelid, color[2];
    if(sscanf(params, "dD(1)D(1)", model, color[0], color[1])) //Error 1
        return SendClientMessage(playerid, 0xFFFFFFFF, "SYNTAX: /spawnveh [modelid] [color1] [color2]");

    new Float:fPos[3], veh[MAX_PLAYERS];
    GetPlayerPos(playerid, fPos[0], fPos[1], fPos[2]);
    veh[playerid] = CreateVehicle(modelid, fPos[0], fPos[1], fPos[2], -1, color[0], color[1], -1);
    PutPlayerInVehicle(playerid, veh[playerid], 0);

    new szString[128];
    format(string, sizeof(string), "You have spawned vehicle ID %d with colors %d and %d!", modelid, color[0], color[1]); // All the other Errors
    SendClientMessage(playerid, 0xFFFFFFFF, string);
    return 1;
}
Reply
#2

Change:
pawn Код:
new modelid, color[2];
to
pawn Код:
new modelid, color[2], string[128];
and

Change
pawn Код:
if(sscanf(params, "dD(1)D(1)", model, color[0], color[1]))
to
pawn Код:
if(sscanf(params, "dD(1)D(1)", modelid, color[0], color[1]))
Reply
#3

And remove
pawn Код:
new szString[128];
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)