10.08.2011, 00:20
(
Последний раз редактировалось TheChaoz; 10.08.2011 в 03:52.
)
pawn Код:
//reemplaza vehiculo1, vehiculo2, etc x las id de los modelos q correspondan
new Count[MAX_PLAYERS], Timer[MAX_PLAYERS];
public OnPlayerConnect(playerid){
Timer[playerid] = -1;
Count[playerid] = 0;
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if(Timer[playerid] != -1)KillTimer(Timer[playerid]);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason){
if(IsPlayerInAnyVehicle(killerid)){
switch(GetVehicleModel(GetPlayerVehicleID(playerid))){
case vehiculo1, vehiculo2:{
Count[playerid]++;
if(Count[playerid]==5){
Timer[playerid] = SetTimerEx("UseVeh", 5*60*1000, false, "d", playerid);
RemovePlayerFromVehicle(playerid);
}return SendClientMessage(playerid, 0xFF0000FF, "Deja de matar con ese vehiculo o no lo podras usar por 5 minutos.");
}
}
}
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(Count[playerid] == 5){
switch(GetVehicleModel(vehicleid)){
case vehiculo1, vehiculo2:{
SendClientMessage(playerid, 0xFF0000FF, "Error: No puedes subir a este vehiculo, te lo advertimos.");
RemovePlayerFromVehicle(playerid);
}
}
}
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER){
switch(GetVehicleModel(GetPlayerVehicleID(playerid))){
case vehiculo1, vehiculo2:{
SendClientMessage(playerid, 0xFF0000FF, "Error: No puedes subir a este vehiculo, te lo advertimos.");
RemovePlayerFromVehicle(playerid);
}
}
}
return 1;
}
forward UseVeh(playerid);
public UseVeh(playerid)
{
Count[playerid] = 0;
}
PD: la proxima ponelo en PEDIDOS