SA-MP Forums Archive
Gangs Private + Error !!! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Gangs Private + Error !!! (/showthread.php?tid=360399)



Gangs Private + Error !!! - duongtong - 17.07.2012

Quote:

new HMcar;
new HTcar;

HMcar = AddStaticVehicle(...);
HTcar = AddStaticVehicle(...);(juse example)

public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(vehicleid == HMcar && PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11)
{
SendClientMessage(playerid, 0x9ACD32AA, "________HM________");
SendClientMessage(playerid, 0x9ACD32AA, "______________________________");
}
else if(vehicleid == HMcar && PlayerInfo[playerid][pMember] != 11 || PlayerInfo[playerid][pLeader] != 11)
{
SendClientMessage(playerid, 0x9ACD32AA, "you're not member{FF6347}HM{AFAFAF}");
RemovePlayerFromVehicle(playerid);
}
else if(vehicleid == HTcar && PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12)
{
SendClientMessage(playerid, 0x9ACD32AA, "________HT________");
SendClientMessage(playerid, 0x9ACD32AA, "___________________________________");
}
else if(vehicleid == HTcar && PlayerInfo[playerid][pMember] != 12 || PlayerInfo[playerid][pLeader] != 12)
{
SendClientMessage(playerid, 0x9ACD32AA, "you're not member {FF6347}HT{AFAFAF}");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
}

What's wrong with it ?
First
i'm leader 11
i get in HM car, nothing wrong
i'm not leader 11
i get in HM car, i can't get in => nothing wrong

But, when i'm leader 12 or not, i still get in HT car