03.01.2011, 16:26
dale, como se tranca um carro na versao 0.3c do samp
ajuda ale
pawn Код:
LockCar(..);//nao funciona
UnLockCar(...)//tbm nao
LockCar(..);//nao funciona
UnLockCar(...)//tbm nao
if(strcmp(cmd, "/lock", true) == 0)
{
for(new i=0; i < MAX_PLAYERS; i++)
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,0,1);
return 1;
}
if(strcmp(cmd, "/unlock", true) == 0)
{
for(new i=0; i < MAX_PLAYERS; i++)
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,0,0);
return 1;
}
if(!strcmp(cmdtext, "/trancar", true))
{
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 trancar esse veнculo!");
for(new i=0;i<MAX_PLAYERS;i++) if(i != playerid)
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1);
SendClientMessage(playerid, Verde, "VEICULO TRANCADO.");
return true;
}
if(!strcmp(cmdtext, "/destrancar", true))
{
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, Branco, "VEICULO DESTRANCADO.");
return true;
}
carrocasa[idx] = CreateVehicle(HouseInfo[idx][CarroModelo],HouseInfo[idx][CarroX],HouseInfo[idx][CarroY],HouseInfo[idx][CarroZ],HouseInfo[idx][CarroR],HouseInfo[idx][CarroCor1],HouseInfo[idx][CarroCor2],99999999);
new carroid = TotalCarrosPadrao + TotalCarrosVip + idx;
HouseInfo[idx][CarroID] = carroid;
if(HouseInfo[idx][VehTrancado] == 1)
{
for(new i=0;i<MAX_PLAYERS;i++)
SetVehicleParamsForPlayer(carrocasa[idx],i, 0, 1);
}
if(strcmp(cmd, "/lock", true) == 0)
{
for(new i=0; i < MAX_PLAYERS; i++)
for(new v=0; v < MAX_VEHICLES; v++)
SetVehicleParamsForPlayer(carrocasa[v],i,0,1);
return 1;
}
if(strcmp(cmd, "/unlock", true) == 0)
{
for(new i=0; i < MAX_PLAYERS; i++)
for(new v=0; v < MAX_VEHICLES; v++)
SetVehicleParamsForPlayer(carrocasa[v],i,0,0);
return 1;
}
for(new i=0; i < MAX_PLAYERS; i++)
for(new v=0; v < MAX_VEHICLES; v++)
SetVehicleParamsForPlayer(carrocasa[v],i,0,1);
agora fico simples
pawn Код:
se nгo quiser que player fasca cmd coloque isso em OnGameModeInit pawn Код:
|
for(new i=0; i < MAX_PLAYERS; i++)