26.02.2010, 01:22
pawn Code:
if(!strcmp(cmdtext,"/addcar",true))
{
if(IsPlayerAdmin(playerid))
{
new Car;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){ return SendClientMessage(playerid, GREY,"USAGE: /addcar [ModelID] [Color1] [Color2] [Price] [Description]");}
new CarModel=strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){ return SendClientMessage(playerid, GREY,"USAGE: /addcar [ModelID] [Color1] [Color2] [Price] [Description]");}
new CarColor1=strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){ return SendClientMessage(playerid, GREY,"USAGE: /addcar [ModelID] [Color1] [Color2] [Price] [Description]");}
new CarColor2=strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){ return SendClientMessage(playerid, GREY,"USAGE: /addcar [ModelID] [Color1] [Color2] [Price] [Description]");}
// new CarPrice=strval(tmp);
// tmp = strtok(cmdtext, idx);
// if(!strlen(tmp)){ return SendClientMessage(playerid, GREY,"USAGE: /addcar [ModelID] [Color1] [Color2] [Price] [Description]");}
// new CarDescription[128];
// if(!strlen(tmp)){ return SendClientMessage(playerid, GREY,"USAGE: /addcar [ModelID] [Color1] [Color2] [Price] [Description]");}
new Float:CarX,Float:CarY,Float:CarZ,Float:CarA;
GetPlayerPos(playerid,CarX,CarY,CarZ);
GetPlayerFacingAngle(playerid,CarA);
CarInfo[Car][cModel]=CarModel;
CarInfo[Car][cX]=CarX;
CarInfo[Car][cY]=CarY;
CarInfo[Car][cZ]=CarZ;
CarInfo[Car][cA]=CarA;
CarInfo[Car][cColor1]=CarColor1;
CarInfo[Car][cColor2]=CarColor2;
CarInfo[Car][cOwned]=0;
// CarInfo[Car][cOwner]=
// CarInfo[Car][cDescription]=CarDescription
// CarInfo[Car][cPrice]=CarPrice;
CarInfo[Car][cLock]=0;
CarInfo[Car][cResTime]=999999;
CreateVehicle(CarInfo[Car][cModel],CarInfo[Car][cX],CarInfo[Car][cY],CarInfo[Car][cZ],CarInfo[Car][cA],CarInfo[Car][cColor1],CarInfo[Car][cColor2],CarInfo[Car][cResTime]);
SaveCars(Car);
return 1;
}
else return SendClientMessage(playerid,GREY,"Attempt Denied, You are not an Administrator!");
}