18.04.2011, 08:41
When i'm do this command, all the time its saying to me that:
usage: /vcreate bla bla bla bla ..
this is the command:
usage: /vcreate bla bla bla bla ..
this is the command:
PHP код:
if(!strcmp(cmd,"/vcreate",true))
{
if(PDataBase[playerid][AdminLevel] <= 4) return SendClientMessage(playerid, COLOR_RED, "[Error]: Access Denied [Level 4+]");
new
Float:Pos[4],
/*ivPrice,
ivModel,
ivColors[2],*/
price[256],
color1[256],
color2[256],
iMsg[256];
price = strtok(cmdtext,idx);
color1 = strtok(cmdtext,idx);
color2 = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_WHITE,"USE Way: /vCreate [Vehicle Model] [Price] [Color1] [Color2]");
if(!strlen(price)) return SendClientMessage(playerid,COLOR_WHITE,"USE Way: /vCreate [Vehicle Model] [Price] [Color1] [Color2]");
if(!strlen(color1)) return SendClientMessage(playerid,COLOR_WHITE,"USE Way: /vCreate [Vehicle Model] [Price] [Color1] [Color2]");
if(!strlen(color2)) return SendClientMessage(playerid,COLOR_WHITE,"USE Way: /vCreate [Vehicle Model] [Price] [Color1] [Color2]");
//if(sscanf(cmdtext, "iiii", ivModel, ivPrice, ivColors[0], ivColors[1])) return SendClientMessage(playerid, COLOR_WHITE,"USE Way: /vCreate [Vehicle Model] [Price] [Color1] [Color2]");
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
GetPlayerFacingAngle(playerid, Pos[3]);
Created++;
vInfo[Created][vModel] = strval(tmp);
vInfo[Created][vColor1] = strval(color1);
vInfo[Created][vColor2] = strval(color2);
vInfo[Created][vPrice] = strval(price);
vInfo[Created][vPosX] = Pos[0];
vInfo[Created][vPosY] = Pos[1];
vInfo[Created][vPosZ] = Pos[2];
vInfo[Created][vPosA] = Pos[3];
strmid(vInfo[Created][vOwner], "Unbought", 0, 256);
strmid(vInfo[Created][vPlate], "ChangeME", 0, 256);
new
vFile[15];
format(vFile, sizeof(vFile), "SERVER-Vehicles/%d.ini", Created);
dini_IntSet(vFile, "Model", strval(tmp));
dini_IntSet(vFile, "Color1", strval(color1));
dini_IntSet(vFile, "Color2", strval(color2));
dini_IntSet(vFile, "Price", strval(price));
dini_Set(vFile, "Owner", "Unbought");
dini_FloatSet(vFile, "vPosX", Pos[0]);
dini_FloatSet(vFile, "vPosY", Pos[1]);
dini_FloatSet(vFile, "vPosZ", Pos[2]);
dini_FloatSet(vFile, "vPosA", Pos[3]);
dini_Set(vFile, "Plate", "ChangeME");
new
cCar = CreateVehicle(strval(tmp), Pos[0], Pos[1], Pos[2], Pos[3], strval(color1), strval(color2), 500000);
SetVehicleNumberPlate(cCar, "ChangeME");
ivCreated[cCar] = Created;
SavePrivVeh(Created);
format(iMsg, sizeof(iMsg), ""#CYELLOW"[Info] Vehicle: "#CBLUE"%i (VID: %i) "#CYELLOW"has been created. Price: "#CBLUE"$%i "#CYELLOW"Plate: "#CBLUE"ChangeME", strval(tmp), Created, strval(price));
SendClientMessage(playerid, COLOR_WHITE, iMsg);
return 1;
}