24.05.2014, 19:55
In the code provided below when a player types /work and if he's near Area 51 or SF Carrier he gets a checkpoint so if
he's near sf carrier , he should get an message saying fly from sf carrier to a51 and viseversa .
So i've tried to make the code work but it doesn't .
Any suggestions ? :
Well ofcourse i dont get any errors , its just that the code is not right .
What i wanted it to do :
When he is in sf carrier he gets a cp to sf carrier and when he enters it he gets a cp to a51 and viseversa .
he's near sf carrier , he should get an message saying fly from sf carrier to a51 and viseversa .
So i've tried to make the code work but it doesn't .
Any suggestions ? :
pawn Код:
if(checkpointid == CP_SFCarrier)
{
new string[200];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
new imoney = RandomEx( 10000,30000 );
format(string,sizeof(string),"[{FFA500}FLIGHT COMPLETED{EEEEEE}]You completed a flight from A51 to SF Carrier and got %d",imoney);
SendClientMessage(playerid,COLOR_ORANGE,string);
format(string,sizeof(string),"[{FFA500}ARMY FLIGHT{EEEEEE}%s has completed a military flight from A51 to SF Carrier and got %d",pName,imoney);
SendClientMessageToAll(COLOR_ORANGE,string);
}
if(checkpointid == CP_A51)
{
new string[200];
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
new imoney = RandomEx( 10000,30000 );
format(string,sizeof(string),"[{FFA500}FLIGHT COMPLETED{EEEEEE}]You completed a flight from SF Carrier to A51 and got %d",imoney);
SendClientMessage(playerid,COLOR_ORANGE,string);
format(string,sizeof(string),"[{FFA500}ARMY FLIGHT{EEEEEE}%s has completed a military flight from SF Carrier to A51 and got %d",pName,imoney);
SendClientMessageToAll(COLOR_ORANGE,string);
}
CMD:work(playerid,params[])
{
if(gTeam[playerid] == TEAM_ARMY)
{
if(IsPlayerInRangeOfPoint(playerid,50.0,-1314.2576,498.6849,18.2344))
{
CP_SFCarrier = CreateDynamicCP(-1314.2576,498.6849,18.2344,-1,-1,-1,-1,30.0);
SendClientMessage(playerid,COLOR_ORANGE,"[{FFA500}FLIGHT{EEEEEE}]Complete a flight from SF Carrier to A51");
}
if(IsPlayerInRangeOfPoint(playerid,50.0,311.3356,2049.9468,17.6406))
{
CP_A51 = CreateDynamicCP(311.3356,2049.9468,17.6406,-1,-1,-1,-1,50.0);
SendClientMessage(playerid,COLOR_ORANGE,"[{FFA500}FLIGHT{EEEEEE}]Complete a flight from A51 to SF Carrier");
}
}
return 1;
}
What i wanted it to do :
When he is in sf carrier he gets a cp to sf carrier and when he enters it he gets a cp to a51 and viseversa .