why this /car command gives me errors?
#10

The reason that it gave you that is on my post above. It expects a string
Код:
GetVehicleModelID(vName[])
and you gave an integer
pawn Код:
CMD:car(playerid, params[])
{
    if(PlayerInfo[playerid][World] != DMWorldID)
    {
        new aVehicle[ 64 ], Color1, Color2;
        if(sscanf(params, "s[64]I(-1)I(-1)", aVehicle, Color1, Color2)) return SendClientMessage(playerid,COLOR_YELLOW, "Correct usage: /car [car ID/name] [color1] [color2]");
        new veh = GetVehicleModelID(aVehicle);
        if(veh < 400 || veh > 611) return SendClientMessage(playerid,COLOR_RED, "ERROR: This is not a valid vehicle name! Please try again ");
        new Float:Pos[4];
        GetPlayerPos(playerid, Pos[0],Pos[1],Pos[2]); GetPlayerFacingAngle(playerid, Pos[3]);
        if(IsPlayerInAnyVehicle(playerid)) { DestroyVehicle(GetPlayerVehicleID(playerid)); }
        new PVeh = CreateVehicle(veh, Pos[0], Pos[1], Pos[2], Pos[3]+90, Color1, Color2, -1);
        LinkVehicleToInterior(PVeh, GetPlayerInterior(playerid));
        SetVehicleVirtualWorld(PVeh, GetPlayerVirtualWorld(playerid));
        PutPlayerInVehicle(playerid, PVeh, 0);
        GameTextForPlayer(playerid, "~y~Enjoy your new ~r~ride", 2000, 1);
        return 1;
    }
    else return SendClientMessage(playerid, COLOR_RED, "ERROR: you can't use this command when in DeathMatch World");
}
Reply


Messages In This Thread
why this /car command gives me errors? - by niels44 - 21.11.2012, 08:21
Re: why this /car command gives me errors? - by Glad2BeHere - 21.11.2012, 08:25
Re: why this /car command gives me errors? - by niels44 - 21.11.2012, 08:28
Re: why this /car command gives me errors? - by Glad2BeHere - 21.11.2012, 08:40
Re: why this /car command gives me errors? - by niels44 - 21.11.2012, 08:44
Re: why this /car command gives me errors? - by Glad2BeHere - 21.11.2012, 08:56
AW: why this /car command gives me errors? - by Skimmer - 21.11.2012, 08:58
Re: why this /car command gives me errors? - by Konstantinos - 21.11.2012, 09:03
Re: why this /car command gives me errors? - by niels44 - 21.11.2012, 09:10
Re: why this /car command gives me errors? - by Konstantinos - 21.11.2012, 09:14

Forum Jump:


Users browsing this thread: 1 Guest(s)