COMMAND:criarveiculo ( playerid, params[] )
{
return cmd_cv ( playerid, params );
}
COMMAND:cv ( playerid, params[] )
{
if(IsPlayerAdmin(playerid) )
{
new
STR[128],
Float:X,
Float:Y,
Float:Z,
Float:A,
Veiculo,
Modelo,
c1,
c2;
if(sscanf(params, "ddd", Modelo, c1, c2))
return SendClientMessage(playerid, -1, "| AVISO | Use:/cv [Modelo] [cor1] [cor2] ");
if( Modelo >= 400 && Modelo <= 611 )
{
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
Veiculo = AddStaticVehicleEx(Modelo, X, Y, Z, A, c1, c2, 30);
PutPlayerInVehicle(playerid, Veiculo, 0);
format(STR, sizeof (STR), "| INFO | Administrador(a) Vocк criou o Veiculo %d com Sucesso.", Modelo );
SendClientMessage(playerid, -1, STR);
}else{
SendClientMessage(playerid, -1, "| AVISO | ID Invбlido use [400 a 611]");
}
}else{
SendClientMessage(playerid, -1, "| AVISO | Vocк nгo tem Permissгo.");
}
return 1;
}
public OnDialogResponse
CMD:cv(playerid, params[])
{
new cor1, cor2;
//
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, CorErro, "Vocк precisa ser uma Administrador level 1 para usar este comando");
if(pJogando[playerid] == true) return SendClientMessage(playerid, CorErro, "Vocк nгo estб trabalhando!");
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) return SendClientMessage(playerid, CorErro, "Vocк nгo pode criar um carro estando dentro de um.");
if(sscanf(params, "iii", Numero, cor1, cor2)) return SendClientMessage(playerid, CorErro, "USE: /cv [ID] [COR1] [COR2]");
if(Numero < 400 || Numero > 611) return SendClientMessage(playerid, CorErro, "USE IDS entre 400 e 611");
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
if(GetPlayerInterior(playerid) != 0)
{
ID = CreateVehicle(Numero, Pos[0], Pos[1], Pos[2], 90, cor1, cor2, -1);
LinkVehicleToInterior(ID, GetPlayerInterior(playerid));
}
else
{
ID = CreateVehicle(Numero, Pos[0], Pos[1], Pos[2], 90, cor1, cor2, -1);
}
PutPlayerInVehicle(playerid, ID, 0);
FoiCriado[ID] = true;
return 1;
}
HostName: [BPL RPG] Brasil PlayLegends ® v1.1 #RPG
Address: 104.166.82.136:7777 Players: 2 / 100 Ping: 178 Mode: BPL RPG: Brasil Map: Brasil RPG |
pawn Код:
|
if(strcmp(cmd, "/cv", true) == 0) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(pAdmin[playerid] == 2 || pAdmin[playerid] == 3 || pAdmin[playerid] == 4 || pAdmin[playerid] == 5){
new tmp[256];
new plid;
//new carro;
new Float:X,Float:Y,Float:Z,Float:Angle;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "(ERRO) Digite: /cv [id-do-caro]");
return 1;
}
plid = strval(tmp);
if(plid==3 || plid==2 || plid==1 || plid==4 || plid==5 || plid==56 || plid==50 || plid==43 || plid==52 || plid==44|| plid==45 ){
SendClientMessage(playerid, Vermelho, "[SERVER] ID de carro Proibido!");
return 1;
}
if(IsPlayerConnected(playerid)){
if(plid >= 400 && plid <= 611){
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
new carro = CreateVehicle(plid, X, Y, Z, Angle, -1, -1, 120000);
PutPlayerInVehicle(playerid,carro,0);
if(GetPlayerInterior(playerid))
LinkVehicleToInterior(carro,GetPlayerInterior(playerid));
SetVehicleVirtualWorld(carro,GetPlayerVirtualWorld(playerid));
format(string, sizeof(string), "| INFO | Vocк criou o veнculo de id: %d", plid);
SendClientMessage(playerid, tcadm, string);
return 1;
}else{
SendClientMessage(playerid, Vermelho, "(ERRO) ID invбlido || ID's = 400-611");
return 1;
}
}
}
}
// CMD PARA CRIAR O VEICULO
COMMAND:criarveiculo ( playerid, params[] )
{
return cmd_cv ( playerid, params );
}
COMMAND:cv ( playerid, params[] )
{
if(IsPlayerAdmin(playerid) )
{
new
STR[128],
Float:X,
Float:Y,
Float:Z,
Float:A,
Veiculo,
Modelo,
c1,
c2;
if(sscanf(params, "ddd", Modelo, c1, c2))
return SendClientMessage(playerid, -1, "| AVISO | Use:/cv [Modelo] [cor1] [cor2] ");
if( Modelo >= 400 && Modelo <= 611 )
{
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
Veiculo = AddStaticVehicleEx(Modelo, X, Y, Z, A, c1, c2, 30);
PutPlayerInVehicle(playerid, Veiculo, 0);
format(STR, sizeof (STR), "| INFO | Administrador(a) Vocк criou o Veiculo %d com Sucesso.", Modelo );
SendClientMessage(playerid, -1, STR);
}else{
SendClientMessage(playerid, -1, "| AVISO | ID Invбlido use [400 a 611]");
}
}else{
SendClientMessage(playerid, -1, "| AVISO | Vocк nгo tem Permissгo.");
}
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
new Destruir;
Destruir = GetPlayerVehicleID(playerid);
DestroyVehicle(Destruir); // se ele sair do Veiculo sera Destruido
return 1;
}