07.07.2012, 17:40
Como eu crio uns veiculos que sу quem й de uma tal profissгo pode usar?
Como eu crio uns veiculos que sу quem й de uma tal profissгo pode usar?
|
//Topo do GM
new Profissao1[3]; // Mude pra quantidade de veiculos que tкm.
// OnGameModeInit
Profissao1[0] = AddStaticVehicleEx(....);
Profissao1[1] = AddStaticVehicleEx(....);
Profissao1[2] = AddStaticVehicleEx(....); // Sempre Inicie contando com 0.
// OnPlayerStateChange
new ProfCars= GetPlayerVehicleID(playerid);
if(ProfCars >= Profissao1[0] && ProfCars<= Profissao1[2])
{
if(VarProfissao[playerid] != DEFINEPROFISSAO) return SendClientMessage(playerid, COR_VermelhoClaro, "[ERRO]: Vocк Nгo й um 'Profissao', Nгo Estб Autorizado a Pegar o Veнculo"), RemovePlayerFromVehicle(playerid);
}
new meucarros[4];
meucarros[0] = CreateVehicle(...);
meucarros[1] = CreateVehicle(...);
meucarros[2] = CreateVehicle(...);
meucarros[3] = CreateVehicle(...);
if(meucarros[3] < (GetPlayerVehicleID(playerid)) > meucarros[0])
{
/// caso o carro do player for da org
}
else
{
// Caso ele nгo for.
}
new VeiculosP[3]; // Topo
// GameModeINit/FilterScriptInit
VeiculosP[0] = AddStaticVehicleEx . . .
VeiculosP[1] = AddStaticVehicleEx . . .
VeiculosP[2] = AddStaticVehicleEx . . .
// StateChange
new Veh = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER)
{
if (Veh >= VeiculosP[0] && Veh <= VeiculosP[2])
{
if (VAR ORG[playerid] != ID ORG) return SendClientMessage(playerid, -1, " Vocк nг e da ORG."), RemovePlayerFromVehicle(playerid);
}
}
return 1;
}
C:\Users\Leandro\Desktop\samp03e_svr_win32\gamemod es\GM.pwn(719) : error 017: undefined symbol "VAR" C:\Users\Leandro\Desktop\samp03e_svr_win32\gamemod es\GM.pwn(719) : error 017: undefined symbol "ORG" C:\Users\Leandro\Desktop\samp03e_svr_win32\gamemod es\GM.pwn(719) : error 029: invalid expression, assumed zero C:\Users\Leandro\Desktop\samp03e_svr_win32\gamemod es\GM.pwn(719) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. |
if (VAR ORG(playerid) != PROF_cop) return SendClientMessage(playerid, -1, " Vocк nг e da ORG."), RemovePlayerFromVehicle(playerid); |
C:\Users\Leandro\Desktop\samp03e_svr_win32\gamemod es\GM.pwn(719) : error 029: invalid expression, assumed zero C:\Users\Leandro\Desktop\samp03e_svr_win32\gamemod es\GM.pwn(719) : warning 215: expression has no effect C:\Users\Leandro\Desktop\samp03e_svr_win32\gamemod es\GM.pwn(719) : error 001: expected token: ";", but found ")" C:\Users\Leandro\Desktop\samp03e_svr_win32\gamemod es\GM.pwn(719) : error 029: invalid expression, assumed zero C:\Users\Leandro\Desktop\samp03e_svr_win32\gamemod es\GM.pwn(719) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. |
if (PROF_cop(playerid) != 1) return SendClientMessage(playerid, -1, " Vocк nгo й um Policial."), RemovePlayerFromVehicle(playerid); |
ja mudei __*
acho q devo ter dado CTRL+z e volta mas й esses erros aqui malz e a linha certa |
if (PROF_cop[playerid] != 1) return SendClientMessage(playerid, -1, " Vocк nгo й um Policial."), RemovePlayerFromVehicle(playerid);
ja mudei __*
acho q devo ter dado CTRL+z e volta mas й esses erros aqui malz e a linha certa |
if (ProfissaoJogador[playerid] != PROF_cop) return SendClientMessage(playerid, -1, " Vocк nгo й um Policial."), RemovePlayerFromVehicle(playerid);
#define PROF_cop 1 #define PROF_CANTOR 2 forward CarregarProfissao(playerid); new Profissao[MAX_PLAYERS]; |
CMD:cop(playerid, params[]) { if(Profissao[playerid] == PROF_cop ) Profissao[playerid] = PROF_cop; SetPlayerColor(playerid, -1); return 1; } CMD:cantor(playerid, params[]) { if(Profissao[playerid] == PROF_CANTOR) Profissao[playerid] = PROF_CANTOR; SendClientMessage(playerid, -1, "Vocк virou cantor ! ![]() SetPlayerColor(playerid, 0x456EAF67); return 1; } |
if (Profissao[playerid] != PROF_cop) return SendClientMessage(playerid, -1, " Vocк nгo й um Policial."), RemovePlayerFromVehicle(playerid);
Aproveitando o topic ainda
if(Profissao[playerid] == POLICIAL) isso aqui da aprofissгo ao player nй? entao quando eu digito o CMD para pegar a prof aparece la Vocк й um policial, mas quando vou pegar o carro fala que nгo sou e sai do carro. ![]() |
Profissao[playerid] = POLICIAL;