if(!strcmp(cmd, "/windows", true) || !strcmp(cmd, "/wi", true))
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You need to login first ! ");
return 1;
}
if(IsPlayerInAnyVehicle(playerid))
{
if(VehicleWindows[GetPlayerVehicleID(playerid)] == 0)
{
VehicleWindows[GetPlayerVehicleID(playerid)] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "***%s rolls down the window.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
ShowNameTags(true);
return 1;
}
else if(VehicleWindows[GetPlayerVehicleID(playerid)] == 1)
{
VehicleWindows[GetPlayerVehicleID(playerid)] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "***%s rolls up the window.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
ShowNameTags(false);
return 1;
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You need to be in the vehicle to use this function !");
return 1;
}
}
return 1;
}
Originally Posted by mansonh
Everything looks ok.
Whats your definition for VehicleWindows |
new VehicleWindows[MAX_VEHICLES] = 0;
if(!strcmp(cmd, "/windows", true) || !strcmp(cmd, "/wi", true))
{
if(!gPlayerLogged[playerid])return SendClientMessage(playerid, COLOR_GREY, " You need to login first ! ");
if(IsPlayerInAnyVehicle(playerid))
{
if(!VehicleWindows[GetPlayerVehicleID(playerid)])
{
VehicleWindows[GetPlayerVehicleID(playerid)] = 1;
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "***%s rolls down the window.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
for(new ply;ply<MAX_PLAYERS;ply)ShowPlayerNameTagForPlayer(ply, playerid, false);
}else{
VehicleWindows[GetPlayerVehicleID(playerid)] = 0;
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "***%s rolls up the window.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
for(new ply;ply<MAX_PLAYERS;ply)ShowPlayerNameTagForPlayer(ply, playerid, true);
}
}
else return SendClientMessage(playerid, COLOR_GREY, " You need to be in the vehicle to use this function !");
return 1;
}
for(new ply;ply<MAX_PLAYERS;ply)ShowPlayerNameTagForPlayer(ply, playerid, false);
for(new ply;ply<MAX_PLAYERS;ply++)ShowPlayerNameTagForPlayer(ply, playerid, false);
Originally Posted by mansonh
Код:
for(new ply;ply<MAX_PLAYERS;ply++)ShowPlayerNameTagForPlayer(ply, playerid, false); |
Originally Posted by mansonh
Код:
for(new ply;ply<MAX_PLAYERS;ply++)ShowPlayerNameTagForPlayer(ply, playerid, false); |