01.12.2012, 09:24
Press Ctrl + G and type 220, and delete the following
Also, you have double {{.
pawn Код:
new string[/* value here */];
// It may be 128;
pawn Код:
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
if(strcmp(cmdtext, "/veh", true) == 0)
{
new CreatedCars[100];
new CreatedCar;
new idx;
new tmp[128];
new cmd[256];
cmd = strtok(cmdtext, idx);
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0x4B00B0AA, "Gamoyeneba: /veh [carid] [color1] [color2]");
return 1;
}
new car;
car = strval(tmp);
if(car < 400 || car > 611) { SendClientMessage(playerid, 0x4B00B0AA, " Vehicle Number can't be below 400 or above 611 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0x4B00B0AA, "USAGE: /veh [carid] [color1] [color2]");
return 1;
}
new color1;
color1 = strval(tmp);
if(color1 < 0 || color1 > 126) { SendClientMessage(playerid, 0x4B00B0AA, " Color Number can't be below 0 or above 126 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0x4B00B0AA, "USAGE: /veh [carid] [color1] [color2]");
return 1;
}
new color2;
color2 = strval(tmp);
if(color2 < 0 || color2 > 126) { SendClientMessage(playerid, 0x4B00B0AA, " Color Number can't be below 0 or above 126 !"); return 1; }
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X,Y,Z);
new carid = CreateVehicle(car, X,Y,Z, 0.0, color1, color2, 60000);
CreatedCars[CreatedCar] = carid;
CreatedCar ++;
new string[64]; // <--
format(string, sizeof(string), " Vehicle %d spawned.", carid);
SendClientMessage(playerid, 0x4B00B0AA, string);
}
return 1;
}
return 0;
}