command help -
GeneralAref - 02.12.2015
i have this:
Код:
CMD:ar(playerid, params[])
{
if(gTeam[playerid] == TEAM_Internationalforces)
{
SendClientMessage(playerid,COLOR_BLUE,"i need air recon online!");
SendClientMessage(playerid,COLOR_BLUE,"copy that we are coming to your position in 2 sec!");
SendClientMessage(playerid,COLOR_RED,"You lost $90000 for air recon.");
TogglePlayerControllable(playerid, 0);
new Float:v, Float:c, Float:r;
GetPlayerPos(playerid, v, c, r);
SetPlayerCameraPos(playerid, v, c, r+30);
SetPlayerCameraLookAt(playerid, v, c, r);
SetTimer("endar", 60000, false);
GivePlayerMoney(playerid, -90000);
return SendClientMessage(playerid,COLOR_BLUE,"We are in your position you can use Satellite!");
}
if(gTeam[playerid] != TEAM_Internationalforces) return SendClientMessage(playerid,COLOR_RED,"ERROR: Your team dosent have Satellite!");
return 1;
}
i need if player use upper command ,and type this command:
Код:
CMD:endar(playerid, params[])
{
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid, 1);
return 1;
}
off upper command.
And if not use sendcilentmassage.
Re: command help -
gurmani11 - 02.12.2015
PHP код:
CMD:ar(playerid, params[])
{
// Check if air recon is already online then send error message
if(GetPVarInt(playerid,"AirReconOnline"))return SendClientMessage(playerid,COLOR_RED,"ERROR: You have already set the Air Recon Online!");
if(gTeam[playerid] == TEAM_Internationalforces)
{
SendClientMessage(playerid,COLOR_BLUE,"i need air recon online!");
SendClientMessage(playerid,COLOR_BLUE,"copy that we are coming to your position in 2 sec!");
SendClientMessage(playerid,COLOR_RED,"You lost $90000 for air recon.");
TogglePlayerControllable(playerid, 0);
new Float:v, Float:c, Float:r;
GetPlayerPos(playerid, v, c, r);
SetPlayerCameraPos(playerid, v, c, r+30);
SetPlayerCameraLookAt(playerid, v, c, r);
SetTimer("endar", 60000, false);
GivePlayerMoney(playerid, -90000);
SetPVarInt(playerid,"AirReconOnline",true); //Set it online in a pvar
return SendClientMessage(playerid,COLOR_BLUE,"We are in your position you can use Satellite!");
}
if(gTeam[playerid] != TEAM_Internationalforces) return SendClientMessage(playerid,COLOR_RED,"ERROR: Your team dosent have Satellite!");
return 1;
}
CMD:endar(playerid, params[])
{
// Check if Air Recon is not online Then send error message
if(!GetPVarInt(playerid,"AirReconOnline"))return SendClientMessage(playerid,COLOR_RED,"ERROR: You have not set the Air Recon Online first!");
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid, 1);
DeletePVar(playerid,"AirReconOnline"); // After starting it delete it so one cannot spam it twice or thrice
return 1;
}
Re: command help -
GeneralAref - 02.12.2015
thanks for it and can you add timer for it?300 sec.Thanks again
how to on night vision ?on this command
Re: command help -
GeneralAref - 02.12.2015
Код:
if(gTeam[playerid] != TEAM_Internationalforces) return SendClientMessage(playerid,COLOR_RED,"ERROR: Your team dosent have Satellite!");
not work!!!
Re: command help -
gurmani11 - 02.12.2015
put it above the code so it will be checked first
Re: command help -
GeneralAref - 02.12.2015
i test it on team 1 thats work but team 2 dosent work
Re: command help -
GeneralAref - 02.12.2015
this works.i test it.and thanks for your help
Код:
CMD:ar(playerid, params[])
{
// Check if air recon is already online then send error message
if(GetPVarInt(playerid,"AirReconOnline"))return SendClientMessage(playerid,COLOR_RED,"ERROR: You have already set the Air Recon Online!");
if(gTeam[playerid] != TEAM_Internationalforces) return SendClientMessage(playerid,COLOR_RED,"ERROR: Your team dosent have Satellite!");
if(gTeam[playerid] == TEAM_Internationalforces)
{
if(GetPlayerMoney(playerid) < 90000) return SendClientMessage(playerid,0xFF0000FF,"You dont have money to use Satellite!");
SendClientMessage(playerid,COLOR_BLUE,"i need air recon online!");
SendClientMessage(playerid,COLOR_BLUE,"copy that we are coming to your position in 2 sec!");
SendClientMessage(playerid,COLOR_RED,"You lost $90000 for air recon.");
TogglePlayerControllable(playerid, 0);
new Float:v, Float:c, Float:r;
GetPlayerPos(playerid, v, c, r);
SetPlayerCameraPos(playerid, v, c, r+30);
SetPlayerCameraLookAt(playerid, v, c, r);
SetTimer("endar", 60000, false);
GivePlayerMoney(playerid, -90000);
SetPVarInt(playerid,"AirReconOnline",true); //Set it online in a pvar
return SendClientMessage(playerid,COLOR_BLUE,"We are in your position you can use Satellite!");
}
return 1;
}