11.05.2010, 14:21
Ola , eu queria saber como eu coloco os veiculos por cargo . exemplo hydra da GN so poder entrar cargo 3+
public OnPlayerEnterVehicle(playerid, vehicleid) { if(Cargo[playerid] <3)//Se o cargo for menor que 3... { if(vehicleid == 520)//... e ele entrar no Hydra... { SendClientMessage(playerid,COLOR_RED,"Vocк nгo pode entrar neste veнculo.");//Vai receber esta mensagem RemovePlayerFromVehicle(playerid,vehicleid);//E vai ser removido do Hydra return 1; } } else if(Cargo[playerid] >=3) return 1;//Mas se o cargo for maior ou igual a 3, nгo acontece nada. }
Originally Posted by [BEP
GeoPilot ]
Й sу um exemplo, fiz na pressa, adapte se quiser. Код:
public OnPlayerEnterVehicle(playerid, vehicleid) { if(Cargo[playerid] <3)//Se o cargo for menor que 3... { if(vehicleid == 520)//... e ele entrar no Hydra... { SendClientMessage(playerid,COLOR_RED,"Vocк nгo pode entrar neste veнculo.");//Vai receber esta mensagem RemovePlayerFromVehicle(playerid,vehicleid);//E vai ser removido do Hydra return 1; } } else if(Cargo[playerid] >=3) return 1;//Mas se o cargo for maior ou igual a 3, nгo acontece nada. } |
Originally Posted by Ellis_Malta
C:\Users\Ellis Wollia\Desktop\samp03asvr_R4_win32\gamemodes\bpg.p wn(2447) : error 021: symbol already defined: "OnPlayerEnterVehicle"
C:\Users\Ellis Wollia\Desktop\samp03asvr_R4_win32\gamemodes\bpg.p wn(244 : error 028: invalid subscript (not an array or too many subscripts): "pCargo" C:\Users\Ellis Wollia\Desktop\samp03asvr_R4_win32\gamemodes\bpg.p wn(244 : warning 215: expression has no effect C:\Users\Ellis Wollia\Desktop\samp03asvr_R4_win32\gamemodes\bpg.p wn(244 : error 001: expected token: ";", but found "]" C:\Users\Ellis Wollia\Desktop\samp03asvr_R4_win32\gamemodes\bpg.p wn(244 : error 029: invalid expression, assumed zero C:\Users\Ellis Wollia\Desktop\samp03asvr_R4_win32\gamemodes\bpg.p wn(244 : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors. |
Originally Posted by Ellis_Malta
Quote:
|
public OnPlayerStateChange(playerid, newstate, oldstate)
{
//*********AQUI VARRIAVEL IF que CHECA TRABALHO DO PLAYER
if(newstate == PLAYER_STATE_DRIVER)
{
if(GetPlayerVehicleModel(playerid) == IDDOCARRO)//ID DO CARRO
{
RemovePlayerFromVehicle(playerid);
}
}
return 1;
}
Originally Posted by DraKoN
GetoPilot Tem que ser em OnPlayerStateChange.
pawn Код:
|