How to make it with ZCMD & sscanf?
#7

pawn Код:
CMD:v(playerid, params[])
{
    if(IsInDm[playerid] == 1)
    {
        SendClientMessage(playerid, ERROR,"You cannot spawn vehicles until you are in a Deathmatch. Type /leavedm to leave deathmatch.");
    }
    else if(IsInDerby[playerid] == 1)
    {
        SendClientMessage(playerid, ERROR,"You cannot spawn vehicles until you are in a Derby. Type /leavederby to leave derby.");
    }
    else if(IsInRace[playerid] == 1)
    {
        SendClientMessage(playerid, ERROR,"You cannot spawn vehicles until you are in a Race. Type /leaverace to leave race.");
    }
    else if(IsInParkour[playerid] == 1)
    {
        SendClientMessage(playerid, ERROR,"You cannot spawn vehicles until you are in a Parkour. Type /leaveparkour to leave parkour.");
    }
    else if(IsInDrift[playerid] == 1)
    {
        SendClientMessage(playerid, ERROR,"You cannot spawn vehicles until you are in a Drift. Type /leavedrift to leave .");
    }
    else
    {
        if(!strlen(params)) return SendClientMessage(playerid, ERROR, "Usage: /veh [Name/Modelid]");
        new iModel = 0;
        if(!IsNumeric(params))
        {
            for(new i; i < sizeof(vNames); i++)
            {
                        if(!strcmp(params, vNames[i]))
                        {
                                iModel = i;
                                break;
                        }
            }
            if(iModel == 0) return SendClientMessage(playerid, ERROR, "Invalid Vehicle.");
        }
        else iModel = strval(params);

        if(iModel > 611 || iModel < 400) return SendClientMessage(playerid, ERROR, "Vehicle models are between 400 and 611.");
        new Float:x, Float:y, Float:z;
        GetPlayerPos(playerid, x, y, z);
        PutPlayerInVehicle(playerid, CreateVehicle(iModel, x, y, z, 0.0, -1, -1, -1), 0);
    }
    return 1;
}
Its not working in game just giving a message "Invalid Vehicle."
Reply


Messages In This Thread
How to make it with ZCMD & sscanf? - by Spooky - 24.12.2011, 12:32
Re: How to make it with ZCMD & sscanf? - by Ash. - 24.12.2011, 12:40
Re: How to make it with ZCMD & sscanf? - by StreetGT - 24.12.2011, 12:40
Re: How to make it with ZCMD & sscanf? - by Spooky - 24.12.2011, 13:25
Re: How to make it with ZCMD & sscanf? - by Ash. - 24.12.2011, 13:37
Re: How to make it with ZCMD & sscanf? - by Spooky - 24.12.2011, 13:43
Re: How to make it with ZCMD & sscanf? - by Spooky - 24.12.2011, 13:48
Re: How to make it with ZCMD & sscanf? - by coole210 - 24.12.2011, 14:03
Re: How to make it with ZCMD & sscanf? - by Spooky - 24.12.2011, 14:07
Re: How to make it with ZCMD & sscanf? - by coole210 - 24.12.2011, 15:07

Forum Jump:


Users browsing this thread: 3 Guest(s)