Problem with a "UAV" function
#1

Hey guys,

This is my first post here, sorry if I'm doing something wrong!

I have a problem with a system that I call UAV. I'm making a deathmatch server to get better in PAWNO.
I want to have a killstreak system where you get a uav when you have 10 kills.
On to 10th kill you will get all the playersmarkers on the map. The weird thing is that is looks like it's working.
I used Printf to check it and it's reading both UAV==1 and UAV == 0. Plz help me

My code (only the stuff that you need for this function):

PHP код:
public OnPlayerSpawn(playerid)
UAV();
public 
OnPlayerDeath(playeridkilleridreason)
if(
GetPlayerScore(killerid) == 10)
{
     
SetPVarInt(killerid"UAV"1);
     
SendClientMessage(killeridCOLOUR_ORANGE"KILLSTREAK # 10: Your UAV is online.");
     
format(stringsizeof(string), "%s has a Killstreak of ten! Watch out, %s can see you now!"namename);
     
SendClientMessageToAll(COLOUR_ORANGEstring);
}
UAV();
public 
UAV()
{
    for(new 
playeridplayerid MAX_PLAYERSplayerid++)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
GetPVarInt(playerid"UAV")== 1)
            {
                for (new 
showplayeridshowplayerid MAX_PLAYERSshowplayerid++)
                {
                    if(
playerid == showplayerid) break;
                    {
                        if(
IsPlayerConnected(showplayerid))
                        {
                            
SetPlayerMarkerForPlayer(playeridshowplayeridCOLOUR_RED);
                            
printf("UAV: show player %d for player %d"showplayeridplayerid);
                        }
                    }
                }
                
            }
            else
            {
                for (new 
showplayeridshowplayerid MAX_PLAYERSshowplayerid++)
                {
                    if(
playerid == showplayerid) break;
                    {
                        if(
IsPlayerConnected(showplayerid))
                        {
                            
SetPlayerMarkerForPlayer(playeridshowplayeridCOLOUR_INV);
                            
printf("UAV: hide player %d for player %d"showplayeridplayerid);
                        }
                    }
                }
            }
        }
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)