PDA

View Full Version : OnPlayerstatechange Problem


rati555
19/01/2012, 05:37 PM
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new newcar = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER)
{
if(VehicleInfo[newcar][vMember] == gTeam[playerid] && VehicleInfo[newcar][vRank] <= pInfo[playerid][pRank])
{

SendClientMessage(playerid,COLOR_RED,"You can't drive this car");
RemovePlayerFromVehicle(playerid);
}
}
return 1;
}
I want to make that if gTeam == VMember doesn't eject player from vehicle but it happens on the contrary

mineralo
19/01/2012, 06:03 PM
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new newcar = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER)
{
if(VehicleInfo[newcar][vMember] == gTeam[playerid] && VehicleInfo[newcar][vRank] <= pInfo[playerid][pRank])
{
if(gTeam != VMember)
{
SendClientMessage(playerid,COLOR_RED,"You can't drive this car");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
}
return 1;
}
try this

rati555
19/01/2012, 06:19 PM
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new newcar = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER)
{
if(VehicleInfo[newcar][vMember] == gTeam[playerid] && VehicleInfo[newcar][vRank] <= pInfo[playerid][pRank])
{
if(gTeam != VMember)
{
SendClientMessage(playerid,COLOR_RED,"You can't drive this car");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
}
return 1;
}
try this
tried this and error:
error 017: undefined symbol "VMember"


also I tried this but everywhone can enter car
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new newcar = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER)
{
if(VehicleInfo[newcar][vMember] == gTeam[playerid] && VehicleInfo[newcar][vRank] <= pInfo[playerid][pRank])
{
if(gTeam[playerid] != VehicleInfo[newcar][vMember])
{
SendClientMessage(playerid,COLOR_RED,"You can't drive this car");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
}
return 1;
}

sameer419
19/01/2012, 06:23 PM
Do you want eject or lock?

rati555
19/01/2012, 06:25 PM
I want to eject((RemovePlayerFromVehicle))

[ABK]Antonio
19/01/2012, 06:42 PM
if(VehicleInfo[newcar][vMember] != gTeam[playerid] || pInfo[playerid][pRank] < VehicleInfo[newcar][vRank])

Are you trying to do something like this? This would make it so if they aren't part of the gTeam or if they aren't the correct rank we'll boot them out

rati555
19/01/2012, 06:51 PM
Antonio;1635360']if(VehicleInfo[newcar][vMember] != gTeam[playerid] || pInfo[playerid][pRank] < VehicleInfo[newcar][vRank])

Are you trying to do something like this? This would make it so if they aren't part of the gTeam or if they aren't the correct rank we'll boot them out
thanks it worked rep+