//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;
}
fijate si funciona xq lo hice aca directament y es algo incomodo PD: la proxima ponelo en PEDIDOS |
C:\Documents and Settings\L\Escritorio\SERVIDOR\SERVIDOR\filterscripts\matados.pwn(21) : error 022: must be lvalue (non-constant)
C:\Documents and Settings\o\Escritorio\SERVIDOR\SERVIDOR\filterscripts\matados.pwn(21) : warning 215: expression has no effect
C:\Documents and Settings\\Escritorio\SERVIDOR\SERVIDOR\filterscripts\matados.pwn(22) : error 033: array must be indexed (variable "Count")
C:\Documents and Settings\L\Escritorio\SERVIDOR\SERVIDOR\filterscripts\matados.pwn(30) : warning 209: function "OnPlayerDeath" should return a value
C:\Documents and Settings\Lo\Escritorio\SERVIDOR\SERVIDOR\filterscripts\matados.pwn(48) : error 017: undefined symbol "GetPlayerVehicleModel"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
3 Errors.
Count[playerid]++;
Count++;
if(Count==5)
їNo era eso lo que decнas que querнas?, no es un problema. Estб hecho asн. |