How can i make this work ?
#1

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 ? :
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;
}
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 .
Reply


Messages In This Thread
How can i make this work ? - by Johnson_Brooks - 24.05.2014, 19:55
Re: How can i make this work ? - by Johnson_Brooks - 25.05.2014, 08:49
Re : How can i make this work ? - by yusei - 25.05.2014, 08:59
Re: Re : How can i make this work ? - by Johnson_Brooks - 25.05.2014, 09:16
Re: How can i make this work ? - by superrobot48 - 25.05.2014, 09:22
Re : How can i make this work ? - by yusei - 25.05.2014, 09:24
Re: How can i make this work ? - by biker122 - 25.05.2014, 09:27
Re: How can i make this work ? - by BroZeus - 25.05.2014, 09:35
Re: How can i make this work ? - by Johnson_Brooks - 25.05.2014, 10:00
Re : How can i make this work ? - by yusei - 25.05.2014, 10:15

Forum Jump:


Users browsing this thread: 1 Guest(s)