06.02.2016, 20:49
Hi could you tell me how to add the /veh cmd for admins in my script?
you may change the colors and duration of time of respawning the vehicle if you want. #include <a_samp>
#include <zcmd>
#include <sscanf>
CMD:veh(playerid,params[])
{
new id,Float:x,Float:y,Float:z,Float:angle,str[128];
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,angle);
if(sscanf(params,"i",id)) return SendClientMessage(playerid,-1,"[ ! ] Usage: /veh <vehicle id>");
if(pInfo[playerid][pAdmin] == 1) //use your own enum what you use for admins.
{
if(id > 399 && id < 612)
{
CreateVehicle(id,x+1,y+1,z,angle,-1,-1,-1);
format(str,sizeof(str),"You have spawned vehicle id : %s",id);
SendClientMessage(playerid,-1,str);
}
else SendClientMessage(playerid,-1,"Vehicle numbers from 400 to 611 only");
}
else return 0;
return 1;
}