/veh, Spawn Veh cmd
#1

Hello Does someone have a cmd to spawn cars IG?

I need the code to a normal RP GM, (LARP)

I mean the thing when you type /veh so it will show you: Car ID, Color 1 Color 2

That thing.
I htink all know it.
So please send me him
Reply
#2

pawn Код:
if(!strcmp(cmd,"/veh",true))
    {
        cmd=strtok(cmdtext,idx);
        if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /veh [vehicleid] [color 1] [color 2]");
        new car=strval(cmd);
        if(!IsValidvehicleModel(strval(cmd))) return SendClientMessage(playerid,COLOR_GREY,"Invalid vehicle ID.");
        cmd=strtok(cmdtext,idx);
        if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /veh [vehicleid] [color 1] [color 2]");
        new color1=strval(cmd);
        cmd=strtok(cmdtext,idx);
        if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /veh [vehicleid] [color 1] [color 2]");
        new color2=strval(cmd);
        GetPlayerPos(playerid,x,y,z);
        return CreateVehicle(car,x,y,z,0.0,color1, color2,-1);
    }
pawn Код:
IsValidvehicleModel(model) return model>=400&&model<611;
Reply
#3

Quote:
Originally Posted by MenaceX^
pawn Код:
if(!strcmp(cmd,"/veh",true))
    {
        cmd=strtok(cmdtext,idx);
        if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /veh [vehicleid] [color 1] [color 2]");
        new car=strval(cmd);
        if(!IsValidvehicleModel(strval(cmd))) return SendClientMessage(playerid,COLOR_GREY,"Invalid vehicle ID.");
        cmd=strtok(cmdtext,idx);
        if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /veh [vehicleid] [color 1] [color 2]");
        new color1=strval(cmd);
        cmd=strtok(cmdtext,idx);
        if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /veh [vehicleid] [color 1] [color 2]");
        new color2=strval(cmd);
        GetPlayerPos(playerid,x,y,z);
        return CreateVehicle(car,x,y,z,0.0,color1, color2,-1);
    }
pawn Код:
IsValidvehicleModel(model) return model>=400&&model<611;


Thanks, but where to put: IsValidvehicleModel(model) return model>=400&&model<611; ?
Reply
#4

Somewhere in your script...
Reply
#5

no, right after the if statement

pawn Код:
if(!strcmp(cmd,"/veh",true))
    {
        if(IsValidvehicleModel(model)) return model>=400&&model<611;
        cmd=strtok(cmdtext,idx);
        if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /veh [vehicleid] [color 1] [color 2]");
        new car=strval(cmd);
        if(!IsValidvehicleModel(strval(cmd))) return SendClientMessage(playerid,COLOR_GREY,"Invalid vehicle ID.");
        cmd=strtok(cmdtext,idx);
        if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /veh [vehicleid] [color 1] [color 2]");
        new color1=strval(cmd);
        cmd=strtok(cmdtext,idx);
        if(!strlen(cmd)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /veh [vehicleid] [color 1] [color 2]");
        new color2=strval(cmd);
        GetPlayerPos(playerid,x,y,z);
        return CreateVehicle(car,x,y,z,0.0,color1, color2,-1);
    }
Reply
#6

No need guys, i have my own cmd
Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)