30.12.2009, 17:09
my commands don't work i DON4T KNOW WHY..
if(strcmp(cmd,"/ejectall", true)==0)
{
new bjhgjg;
new playerstate = GetPlayerState(playerid);
bjhgjg = GetPlayerVehicleID(playerid);
if (!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid,COLOR_YELLOW,"You're not in a vehicle");
return 1;
}
if (playerstate == PLAYER_STATE_PASSENGER)
{
SendClientMessage(playerid,COLOR_RED,"Passengers can't use This!");
return 1;
}
for (new i=0;i<MAX_PLAYERS;i++)
{
//if ((IsPlayerConnected(i))&&(IsPlayerInVehicle(i,voit ureid)))
if (IsPlayerInVehicle(i,bjhgjg))
{
RemovePlayerFromVehicle(playerid);
GameTextForPlayer(playerid,"~r~YOU'VE BEEN EJECTED!",3000,5);
return 1;
}
}
}
if(strcmp(cmd, "/eject", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new State;
if(IsPlayerInAnyVehicle(playerid))
{
State=GetPlayerState(playerid);
if(State!=PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid,COLOR_GREY," You can only eject people as the driver !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /eject [playerid/PartOfName]");
return 1;
}
new playa;
playa = ReturnUser(tmp);
new test;
test = GetPlayerVehicleID(playerid);
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
if(playa == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Eject yourself!"); return 1; }
if(IsPlayerInVehicle(playa,test))
{
new PName[MAX_PLAYER_NAME];
GetPlayerName(playerid,PName,sizeof(PName));
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You have thrown %s out of the car!", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* You have been thrown out the car by %s !", PName);
SendClientMessage(playa, COLOR_LIGHTBLUE, string);
RemovePlayerFromVehicle(playa);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player is not in your Car !");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Invalid ID/Name!");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You need to be in a Vehicle to use this !");
}
}
return 1;
}
WWho can help me?
Thank you
if(strcmp(cmd,"/ejectall", true)==0)
{
new bjhgjg;
new playerstate = GetPlayerState(playerid);
bjhgjg = GetPlayerVehicleID(playerid);
if (!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid,COLOR_YELLOW,"You're not in a vehicle");
return 1;
}
if (playerstate == PLAYER_STATE_PASSENGER)
{
SendClientMessage(playerid,COLOR_RED,"Passengers can't use This!");
return 1;
}
for (new i=0;i<MAX_PLAYERS;i++)
{
//if ((IsPlayerConnected(i))&&(IsPlayerInVehicle(i,voit ureid)))
if (IsPlayerInVehicle(i,bjhgjg))
{
RemovePlayerFromVehicle(playerid);
GameTextForPlayer(playerid,"~r~YOU'VE BEEN EJECTED!",3000,5);
return 1;
}
}
}
if(strcmp(cmd, "/eject", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new State;
if(IsPlayerInAnyVehicle(playerid))
{
State=GetPlayerState(playerid);
if(State!=PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid,COLOR_GREY," You can only eject people as the driver !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /eject [playerid/PartOfName]");
return 1;
}
new playa;
playa = ReturnUser(tmp);
new test;
test = GetPlayerVehicleID(playerid);
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
if(playa == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Eject yourself!"); return 1; }
if(IsPlayerInVehicle(playa,test))
{
new PName[MAX_PLAYER_NAME];
GetPlayerName(playerid,PName,sizeof(PName));
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* You have thrown %s out of the car!", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* You have been thrown out the car by %s !", PName);
SendClientMessage(playa, COLOR_LIGHTBLUE, string);
RemovePlayerFromVehicle(playa);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " That player is not in your Car !");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Invalid ID/Name!");
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You need to be in a Vehicle to use this !");
}
}
return 1;
}
WWho can help me?
Thank you