Posts: 47
Threads: 7
Joined: Aug 2010
Reputation:
0
Ae pessoal, preciso de ajuda para como criar um /veh tipo
Somente a pessoa logada como admin ou na Rcon pudesse digitar
/veh [carid] [cor1] [cor2]
se a pessoa digitasse
/veh 541 0 0
viesse o carro do id
como um bulet preto
Posts: 1,032
Threads: 2
Joined: Dec 2008
pawn Код:
if(strcmp(cmd, "/veh", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 1337)
{
SendClientMessage(playerid, COLOR_GRAD1, "Dir ist es nicht erlaubt, diesen Befehl zu benutzen!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [AutoID] [Farbe1] [Farbe2]");
return 1;
}
new car;
car = strval(tmp);
if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_GREY, "Fahrzeug-ID kann nicht unter 400 und ьber 611 sein!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [Auto] [Farbe1] [Farbe2]");
return 1;
}
new color1;
color1 = strval(tmp);
if(color1 < 0 || color1 > 126) { SendClientMessage(playerid, COLOR_GREY, "Die Farbe kann nicht unter 0 und ьber 126 sein!"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /veh [AutoID] [Farbe1] [Farbe2]");
return 1;
}
new color2;
color2 = strval(tmp);
if(color2 < 0 || color2 > 126) { SendClientMessage(playerid, COLOR_GREY, "Die Farbe kann nicht unter 0 und ьber 126 sein!"); return 1; }
new Float:X5,Float:Y5,Float:Z5;
GetPlayerPos(playerid, X5,Y5,Z5);
new carid = CreateVehicle(car, X5,Y5,Z5, 0.0, color1, color2, 60000);
CreatedCars[CreatedCar] = carid;
spawncar_gas[carid] = GetVehicleStandartGas(carid);
CreatedCar ++;
format(string, sizeof(string), "Fahrzeug %d wurde gespawned.", carid);
SendClientMessage(playerid, COLOR_GREY, string);
new pppname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pppname, sizeof(pppname));
format(string, sizeof(string), "%s /veh", pppname);
AdmCmdLog(playerid,string);
}
return 1;
}