Hello, I want to create my own DMV script (driving school script) and I got one problem. I would like to prevent players from entering a specified vehicles in state of driver, but my script fails.
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new const vehicleid = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER )
{
if(vehicleid == vmmasinos[0] || vmmasinos[1] || vmmasinos[2] || vmmasinos[3] || vmmasinos[4] || vmmasinos[5] || vmmasinos[6])
{
if(PlayerInfo[playerid][pTeises] == 1 && PlayerInfo[playerid][pTeorija] == 1)
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
SetPlayerPos(playerid,x,y,z);
SendClientMessage(playerid,-1,"[SERVERIS] Tu jau turi teises.");
}
else if(PlayerInfo[playerid][pTeorija] !=1)
{
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
SetPlayerPos(playerid,x,y,z);
SendClientMessage(playerid,-1,"[SERVERIS] Tu nesi iљlaikęs teorijos.");
}
else
{
SendClientMessage(playerid,-1,"VEIKIA");
}
}
}
return 1;
}