10.12.2012, 08:22
Hey, i tried to make a flyingschool system on my server. And when the player type /applylic i set the players team to another team and back when the test is done:
And when the player enter a "schoolplane" it starts some RaceCheckpoint. All this works find, but i want to set the player back to his team that hi was in before the test. so i tried:
Get some error, and i don't know if this code will work. So is it possible to set the team back?
and is it a diffrent way then:
pawn Код:
CMD:applylic(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 4.0, -2032.6999,-117.5,1035.1999))
new lastteam;
lastteam = gTeam[playerid];
{
if(FlyingLic[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "You already have a pilot license.");
if(FlyingLic[playerid] == 0)
{
gTeam[playerid] = TEAM_FLIC;
GivePlayerMoney(playerid, -2000);
SendClientMessage(playerid, COLOR_BLUE, "You have starter San Firros flying test, go out to the hangar ann enter a testplane");
}
}
return 1;
}
pawn Код:
if(FlicC[playerid] == 36)
{
DisablePlayerRaceCheckpoint(playerid);
new Float:health;
new veh;
veh = GetPlayerVehicleID(playerid);
GetVehicleHealth(veh, health);
if(health <700)
{
SendClientMessage(playerid,COLOR_RED,"You failed the Flyingtest,");
SendClientMessage(playerid,COLOR_RED,"try agein!");
}
else
{
SendClientMessage(playerid,COLOR_RED,"Congratulations, you successed the Flyingtest ");
SendClientMessage(playerid,COLOR_RED,"Licenses is now yours!");
(FlyingLic[playerid] = 1);
gTeam[playerid] = lastteam;
}
return 1;
}
and is it a diffrent way then:
pawn Код:
CMD:applylic(playerid, params[])
{
new lastteam;
lastteam = gTeam[playerid];
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
gTeam[playerid] = lastteam;
return 1;
}