25.07.2015, 19:05
Hello guys!
I use my own admin filterscript with sscanf mysql and zcmd.
My problem:
I have this car command:
But I don't want players to spawn Rhino, Seasparrow, Hunter, Hydra and all these types of vehicle! How to make this?
I use my own admin filterscript with sscanf mysql and zcmd.
My problem:
I have this car command:
PHP Code:
CMD:car(playerid,params[]){
new tmp[256],tmp2[256],tmp3[256],Index,str[256];
tmp = strtok(params,Index);
tmp2= strtok(params,Index);
tmp3=strtok(params,Index);
if(!strlen(tmp))return SendClientMessage(playerid,-1,"{FF9900}Usage:{FFFFFF} /car [Model Name][Colour1][Colour2]");
new col1,col2;
if(strlen(tmp2) && strlen(tmp3)){
col1 = strval(tmp2);
col2= strval(tmp3);
}
else{
col1 = random(255);
col2 = random(255);
}
new c=GetVehicleModelIDFromName(tmp);
if(c > 611 || c<400)return SendClientMessage(playerid,-1,"{FF0000}Invalid{FFFFFF} car");
new Float:Pos[4];
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
GetPlayerFacingAngle(playerid,Pos[3]);
DestroyVehicle(P_DATA[playerid][pCar]);
new veh = CreateVehicle(c,Pos[0],Pos[1],Pos[2],Pos[3],col1,col2,60);
PutPlayerInVehicle(playerid,veh,0);
P_DATA[playerid][pCar] = GetPlayerVehicleID(playerid);
format(str,sizeof(str),"{FFFFFF}You have spawned a(n) '{FFFF00}%s{FFFFFF}' with colours '{FFFF00}%d{FFFFFF}' and '{FFFF00}%d{FFFFFF}'.",VehicleNames[c-400],col1,col2);
SendClientMessage(playerid,-1,str);
return 1;
}