23.03.2014, 15:10
i so frustation
sir, can you edit this command to ZCMD?? please
if work, +rep :v
sir, can you edit this command to ZCMD?? please
if work, +rep :v
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new
cmd[128],
tmp[32],
tmp2[256], tmp3[256], tmp4[256],idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/car", true)==0)
{
//if(IsPlayerInAnyVehicle(playerid)) { return SendClientMessage(playerid, COLOUR_ORANGE, "You arleday have a car"); }
tmp = strtok(cmdtext, idx);
tmp2 = strtok(cmdtext,idx);
tmp3 = strtok(cmdtext,idx);
tmp4 = strtok(cmdtext,idx);
if(!strlen(tmp) || strlen(tmp) > 32) { return SendClientMessage(playerid, COLOUR_ORANGE, "System: /car [name/id] [color1] [color2]"); }
new
car,colour1, colour2;
if(!IsNumeric(tmp)) { car = GetVehicleModelIDFromName(tmp); } else { car = strval(tmp); }
if(!strlen(tmp2)) colour1 = random(126); else colour1 = strval(tmp2);
if(!strlen(tmp3)) colour2 = random(126); else colour2 = strval(tmp3);
if(car > 611 || car < 400) { return SendClientMessage(playerid, COLOUR_ORANGE, "Wrong car name or id"); }
if(CreateCar[playerid] != -1) { DestroyVehicle(CreateCar[playerid]); }
new
Float:pos[4];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
GetPlayerFacingAngle(playerid, pos[3]);
CreateCar[playerid] = CreateVehicle(car, pos[0], pos[1], pos[2], pos[3],colour1,colour2, 50000);
SetVehicleNumberPlate(CreateCar[playerid], tmp4);
SetVehicleToRespawn(CreateCar[playerid]);
PutPlayerInVehicle(playerid, CreateCar[playerid], 0);
SetVehicleVirtualWorld(CreateCar[playerid], GetPlayerVirtualWorld(playerid));
new
MaxPlayers = GetMaxPlayers();
for(new i; i < MaxPlayers; i++)
{
if(!IsPlayerConnected(i) || i == playerid) continue;
SetVehicleParamsForPlayer(CreateCar[playerid], i, 0, true);
}
//new
//string[144];
//format(string, sizeof string, " %s SPAWNED SUCCESFUL", VehicleNames[car-400]);
//SendClientMessage(playerid, COLOUR_BLUE, string);
return 1;
}
return 0;
}