26.07.2011, 14:21
hi, i have one problem: i'm creating races with CP and @finish CP it should do this...Well, its working untill the winner is NPC...Even I lose im still get award.
BTW: this messege didn't show up.
BTW: this messege didn't show up.
pawn Код:
stock RaceStats(playerid)
{
if(IsPlayerNPC(playerid))
{
SendClientMessageToAll(RAUDONA,"win npc");
for(new p=0; p<MAX_PLAYERS; p++)
{
new names[26];
GetPlayerName(p,names,sizeof(names));
if(!strcmp(names,"NPC_Racer"))
{
Kick(p);
IsNPCWinner=true;
IsNPCInRace=false;
}
}
ConnectNPC("NPC_Racer","steady");
return 1;
}
if(IsNPCWinner)
{
MissionFailed(playerid);
IsNPCWinner=false;
DisablePlayerRaceCheckpoint(playerid);
}
else
{
DisablePlayerRaceCheckpoint(playerid);
GivePlayerMoney(playerid,10000);
Mprogress6[playerid]=0;
IsPlayerInMission[playerid] = 0;
GameTextForPlayer(playerid,"~w~+10.000$",1500,5);
MissionComplete(playerid);
IsNPCWinner=false;
IsNPCInRace=false;
for(new p=0; p<MAX_PLAYERS; p++)
{
new names[26];
GetPlayerName(p,names,sizeof(names));
if(!strcmp(names,"NPC_Racer"))
{
Kick(p);
}
}
ConnectNPC("NPC_Racer","steady");
}
return 1;
}