03.03.2013, 18:30
Define uma para o carro 1 e outra para o carro 2
PHP код:
cLock2
PHP код:
pCarKey3
PHP код:
pCarKey4
pawn Код:
if(strcmp(cmd,"/veiculo",true)==0 || strcmp(cmd,"/vh",true)==0)
{
new vehid = GetPlayerVehicleID(playerid);
GetPlayerName(playerid,playername,sizeof(playername));
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_WHITE," USE: /veiculo ajuda para ver os comandos de seu veнculo VIP");
return true;
}
if(strcmp(tmp, "ajuda", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pCarKey] != 0 || PlayerInfo[playerid][pCarKey2] != 0)
{
SendClientMessage(playerid, COLOR_GRAD2,"[ /veiculo comprar ] {48CFE0}para comprar o Veiculo");
SendClientMessage(playerid, COLOR_GRAD2,"[ /veiculo vender ] {48CFE0}para vender o Veiculo");
SendClientMessage(playerid, COLOR_GRAD2,"[ /veiculo ajuda ] {48CFE0}para ver os comandos dos Veiculo");
SendClientMessage(playerid, COLOR_GRAD2,"[ /veiculo trancar1 ou /veiculo trancar2 ] {48CFE0}para trancar ou destrancar o Veiculo");
SendClientMessage(playerid, COLOR_GRAD2,"[ /veiculo cor ] {48CFE0}para mudar a cor do Veiculo");
SendClientMessage(playerid, COLOR_GRAD2,"[ /veiculo estacionar ] {48CFE0}para estacionar o Veiculo");
SendClientMessage(playerid, COLOR_GRAD2,"[ /veiculo modelo ] {48CFE0}para mudar o modelo do Veiculo");
SendClientMessage(playerid, COLOR_GRAD2,"[ /retirargrana ] {48CFE0}para retirar a grana do seu Veiculo");
SendClientMessage(playerid, COLOR_LIGHTBLUE,"{93EDDE}Vocк precisa estar no seu carro VIP para usar esses comandos.");
return true;
}
else
{
SendClientMessage(playerid,COLOR_GRAD2," Vocк nгo tem um Veiculo VIP! ");
return true;
}
}
return true;
}
if(strcmp(tmp, "trancar1", true) == 0)
{
if(PlayerInfo[playerid][pCarKey] == 0 && PlayerInfo[playerid][pCarKey2] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк nгo tem um Carro VIP.");
return true;
}
if(PlayerInfo[playerid][pCarKey] != vehid && PlayerInfo[playerid][pCarKey2] != vehid)
{
SendClientMessage(playerid, COLOR_GREY, "Esse nгo й seu Carro VIP.");
return true;
}
new keycar;
if(vehid == PlayerInfo[playerid][pCarKey]) { keycar = PlayerInfo[playerid][pVeiculo]; }
else if(vehid == PlayerInfo[playerid][pCarKey2]) { keycar = PlayerInfo[playerid][pVeiculo2]; }
if(IsPlayerConnected(playerid))
{
if(CarInfo[keycar][cLock] == 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i)) SetVehicleParamsForPlayer(CarInfo[keycar][ownedvehicle],i,0,0);
}
format(string, sizeof(string), "~w~Veiculo VIP~n~~g~Aberto");
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid, string, 10000, 3);
CarInfo[keycar][cLock] = 0;
return true;
}
else
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i)) SetVehicleParamsForPlayer(CarInfo[keycar][ownedvehicle],i,0,1);
}
format(string, sizeof(string), "~w~Veiculo VIP~n~~r~Trancado");
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid, string, 10000, 3);
CarInfo[keycar][cLock] = 1;
return true;
}
}
if(strcmp(tmp, "trancar2", true) == 0)
{
if(PlayerInfo[playerid][pCarKey3] == 0 && PlayerInfo[playerid][pCarKey4] == 0)
{
SendClientMessage(playerid, COLOR_GREY, "Vocк nгo tem um Carro VIP.");
return true;
}
if(PlayerInfo[playerid][pCarKey] != vehid && PlayerInfo[playerid][pCarKey2] != vehid)
{
SendClientMessage(playerid, COLOR_GREY, "Esse nгo й seu Carro VIP.");
return true;
}
new keycar;
if(vehid == PlayerInfo[playerid][pCarKey3]) { keycar = PlayerInfo[playerid][pVeiculo]; }
else if(vehid == PlayerInfo[playerid][pCarKey4]) { keycar = PlayerInfo[playerid][pVeiculo2]; }
if(IsPlayerConnected(playerid))
{
if(CarInfo[keycar][cLock2] == 1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i)) SetVehicleParamsForPlayer(CarInfo[keycar][ownedvehicle],i,0,0);
}
format(string, sizeof(string), "~w~Veiculo VIP~n~~g~Aberto");
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid, string, 10000, 3);
CarInfo[keycar][cLock2] = 0;
return true;
}
else
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i)) SetVehicleParamsForPlayer(CarInfo[keycar][ownedvehicle],i,0,1);
}
format(string, sizeof(string), "~w~Veiculo VIP~n~~r~Trancado");
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid, string, 10000, 3);
CarInfo[keycar][cLock2] = 1;
return true;
}
}
return true;
}