Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(strcmp(cmd, "/addcar", true) == 0)
- {
- if(PlayerInfo[playerid][pAdmin] >= 1)
- {
- new ac;
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)){ SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /addcar [Model] [Color1] [Color2]"); return 1; }
- new cModel = strval(tmp);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)){ SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /addcar [Model] [Color1] [Color2]"); return 1; }
- new cCol1 = strval(tmp);
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)){ SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /addcar [Model] [Color1] [Color2]"); return 1; }
- new cCol2 = strval(tmp);
- new Float:acX, Float:acY, Float:acZ, Float:acA;
- GetPlayerPos(playerid, acX, acY, acZ);
- GetPlayerFacingAngle(playerid, acA);
- DynamicCars[ac][CarModel] = cModel;
- DynamicCars[ac][CarX] = acX;
- DynamicCars[ac][CarY] = acY;
- DynamicCars[ac][CarZ] = acZ;
- DynamicCars[ac][CarAngle] = acA;
- DynamicCars[ac][CarColor1] = cCol1;
- DynamicCars[ac][CarColor2] = cCol2;
- DynamicCars[ac][FactionCar] = 255;
- DynamicCars[ac][CarType] = 0;
- new car = CreateVehicle(DynamicCars[ac][CarModel],DynamicCars[ac][CarX],DynamicCars[ac][CarY],DynamicCars[ac][CarZ],DynamicCars[ac][CarAngle],DynamicCars[ac][CarColor1],DynamicCars[ac][CarColor2],-1);
- PutPlayerInVehicle(playerid,car,0);
- SaveDynamicCars();
- printf("Added Vehicle ID: %d, Vehicle Model: %d", car, cModel);
- return 1;
- }
- else{ SendClientMessage(playerid, COLOR_ADMINCMD, "You aren't authorized to use that command !"); return 1; }
- }
- if(strcmp(cmd, "/delcar", true) == 0)
- {
- if(PlayerInfo[playerid][pAdmin] >= 1337)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- new ac = GetPlayerVehicleID(playerid);
- DestroyVehicle(ac);
- SaveDynamicCars();
- return 1;
- }
- }
- else{ SendClientMessage(playerid, COLOR_ADMINCMD, "You aren't authorized to use that command !"); return 1; }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement