CMD:trancar(playerid)
{
if(IsPlayerInAnyVehicle(playerid))
{
new State=GetPlayerState(playerid);
if(State!=PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid,0xFF004040,"Vocк nгo pode trancar esse veiculo.");
return 1;
}
new i;
for(i=0;i<MAX_PLAYERS;i++)
{
if(i != playerid)
{
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1);
}
}
SendClientMessage(playerid, 0x33AA33AA, "Veiculo Trancado");
new Float:pX, Float:pY, Float:pZ;
GetPlayerPos(playerid,pX,pY,pZ);
PlayerPlaySound(playerid,1056,pX,pY,pZ);
}
}
CMD:destrancar(playerid)
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, vermelho, "Voce nгo estб em um veнculo!");
if(GetPlayerState(playerid)!=PLAYER_STATE_DRIVER) return SendClientMessage(playerid,vermelho,"Voce nгo pode destrancar esse veнculo!");
for(new i=0;i<MAX_PLAYERS;i++)
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 0);
SendClientMessage(playerid, verde, "VEICULO DESTRANCADO.");
return true;
}
CMD:testetrancar(playerid)
{
new carro;
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(carro,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(carro,engine,lights,alarm,1,bonnet,boot,objective);
}
CMD:testedestrancar(playerid)
{
if(chaves[playerid] == true)
{
new carro;
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(carro,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(carro,engine,lights,alarm,0,bonnet,boot,objective);
}
}
IsPlayerInAnyVehicle(playerid) = Vocк precisa estar no veiculo.
PLAYER_STATE_DRIVER = Vocк precisa ser motorista. |
CMD:trancar(playerid)
{
if(!IsPlayerInAnyVehicle(playerid))
return SendClientMessage(playerid,0xFF004040,"Vocк nгo pode trancar esse veiculo.");
static
Int,
P
;
for(Int = 0, P = GetMaxPlayers(); Int != P; ++Int){
if(Int != playerid){
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid), Int, 0, 1);
}
}
SendClientMessage(playerid, 0x33AA33AA, "Veiculo Trancado");
PlayerPlaySound(playerid,1056, 0.0, 0.0, 0.0);
return true;
}
CMD:destrancar(playerid)
{
if(!IsPlayerInAnyVehicle(playerid))
return SendClientMessage(playerid, vermelho, "Voce nгo estб em um veнculo!");
if(GetPlayerState(playerid)!= PLAYER_STATE_DRIVER)
return SendClientMessage(playerid,vermelho,"Voce nгo pode destrancar esse veнculo!");
static
Int,
P
;
for(Int = 0, P = GetMaxPlayers(); Int != P; ++Int){
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),Int, 0, 0);
}
SendClientMessage(playerid, verde, "VEICULO DESTRANCADO.");
return true;
}
Tente isto
pawn Код:
|
Eu nгo sei muito inglкs,mais entendo algumas coisas de lб.
Poderia sу me explicar o bбsico.Como por exemplo setar uma variavel de outro jogador pra true/false. |