SA-MP Forums Archive
Function does not do its job even though it is executed - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Function does not do its job even though it is executed (/showthread.php?tid=540266)



Function does not do its job even though it is executed - Manyula - 03.10.2014

Hello people,

I'm facing a problem that seems impossible to solve. It's about SetPlayerMarkerForPlayer.
My goal is to hide players' markers in the virtuel world 7, and I'm doing that in a CMD.

pawn Код:
COMMAND:bf(playerid, params[])
{
    new Random = random(sizeof(RandomSpawnsBF)),
        pName[MAX_PLAYER_NAME],
        stringDE[128],
        stringEN[128];
    GetPlayerName(playerid, pName, sizeof(pName));
    format(stringDE, sizeof(stringDE), "»DEATHMATCH« {%06x}%s "#C_DM_E"hat das Battlefield-DM betreten! [/BF]", GetPlayerColor(playerid) >>> 8, pName);
    format(stringEN, sizeof(stringEN), "»DEATHMATCH« {%06x}%s "#C_DM_E"has joined the Battlefield-DM ! [/BF]", GetPlayerColor(playerid) >>> 8, pName);
    AddToDM(playerid, stringDE, stringEN, RandomSpawnsBF[Random][0], RandomSpawnsBF[Random][1], RandomSpawnsBF[Random][2], RandomSpawnsBF[Random][3], M4, 1000, UZI, 99999, GRENADE, 5, COMBAT_SHOTGUN, 500, 7, 0);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        printf("World(%d) = %d | %d != %d", i, GetPlayerVirtualWorld(i), i, playerid);
        if(GetPlayerVirtualWorld(i) == 7 && i != playerid)
        {
            printf("Hidden marker for ID %d of ID %d", i, playerid);
            SetPlayerMarkerForPlayer(i, playerid, (GetPlayerColor(playerid) & 0xFFFFFF00));
            printf("Hidden marker for ID %d of ID %d", playerid, i);
            SetPlayerMarkerForPlayer(playerid, i, (GetPlayerColor(i) & 0xFFFFFF00));
        }
    }
    return 1;
}
If you ask yourselves where I set the virtual World: it's the second to last parameter in "AddToDM".

As you can see, I've already debugged the code and it executes perfectly.
However, SetPlayerMarkerForPlayer does not its job even though the function is being executed.

Код:
[22:32:28] World(0) = 0 | 0 != 1
[22:32:28] World(1) = 7 | 1 != 1
[22:32:28] World(2) = 0 | 2 != 1
[22:32:28] World(3) = 0 | 3 != 1
[22:32:28] World(4) = 0 | 4 != 1
[22:32:28] World(5) = 0 | 5 != 1
[22:32:28] World(6) = 0 | 6 != 1
[22:32:28] World(7) = 0 | 7 != 1
[22:32:28] World(8) = 0 | 8 != 1
[22:32:28] World(9) = 0 | 9 != 1
[22:32:28] World(10) = 0 | 10 != 1
[22:32:28] World(11) = 0 | 11 != 1
[22:32:28] World(12) = 0 | 12 != 1
[22:32:28] World(13) = 0 | 13 != 1
[22:32:28] World(14) = 0 | 14 != 1
[22:32:28] World(15) = 0 | 15 != 1
[22:32:28] World(16) = 0 | 16 != 1
[22:32:28] World(17) = 0 | 17 != 1
[22:32:28] World(18) = 0 | 18 != 1
[22:32:28] World(19) = 0 | 19 != 1
[22:32:28] World(20) = 0 | 20 != 1
[22:32:28] World(21) = 0 | 21 != 1
[22:32:28] World(22) = 0 | 22 != 1
[22:32:28] World(23) = 0 | 23 != 1
[22:32:28] World(24) = 0 | 24 != 1
[22:32:28] World(25) = 0 | 25 != 1
[22:32:28] World(26) = 0 | 26 != 1
[22:32:28] World(27) = 0 | 27 != 1
[22:32:28] World(28) = 0 | 28 != 1
[22:32:28] World(29) = 0 | 29 != 1
[22:32:28] World(30) = 0 | 30 != 1
[22:32:28] World(31) = 0 | 31 != 1
[22:32:28] World(32) = 0 | 32 != 1
[22:32:28] World(33) = 0 | 33 != 1
[22:32:28] World(34) = 0 | 34 != 1
[22:32:28] World(35) = 0 | 35 != 1
[22:32:28] World(36) = 0 | 36 != 1
[22:32:28] World(37) = 0 | 37 != 1
[22:32:28] World(38) = 0 | 38 != 1
[22:32:28] World(39) = 0 | 39 != 1
[22:32:28] World(40) = 0 | 40 != 1
[22:32:28] World(41) = 0 | 41 != 1
[22:32:28] World(42) = 0 | 42 != 1
[22:32:28] World(43) = 0 | 43 != 1
[22:32:28] World(44) = 0 | 44 != 1
[22:32:28] World(45) = 0 | 45 != 1
[22:32:28] World(46) = 0 | 46 != 1
[22:32:28] World(47) = 0 | 47 != 1
[22:32:28] World(48) = 0 | 48 != 1
[22:32:28] World(49) = 0 | 49 != 1

[22:32:31] World(0) = 7 | 0 != 0
[22:32:31] World(1) = 7 | 1 != 0
[22:32:31] Hidden marker for ID 1 of ID 0
[22:32:31] Hidden marker for ID 0 of ID 1
[22:32:31] World(2) = 0 | 2 != 0
[22:32:31] World(3) = 0 | 3 != 0
[22:32:31] World(4) = 0 | 4 != 0
[22:32:31] World(5) = 0 | 5 != 0
[22:32:31] World(6) = 0 | 6 != 0
[22:32:31] World(7) = 0 | 7 != 0
[22:32:31] World(8) = 0 | 8 != 0
[22:32:31] World(9) = 0 | 9 != 0
[22:32:31] World(10) = 0 | 10 != 0
[22:32:31] World(11) = 0 | 11 != 0
[22:32:31] World(12) = 0 | 12 != 0
[22:32:31] World(13) = 0 | 13 != 0
[22:32:31] World(14) = 0 | 14 != 0
[22:32:31] World(15) = 0 | 15 != 0
[22:32:31] World(16) = 0 | 16 != 0
[22:32:31] World(17) = 0 | 17 != 0
[22:32:31] World(18) = 0 | 18 != 0
[22:32:31] World(19) = 0 | 19 != 0
[22:32:31] World(20) = 0 | 20 != 0
[22:32:31] World(21) = 0 | 21 != 0
[22:32:31] World(22) = 0 | 22 != 0
[22:32:31] World(23) = 0 | 23 != 0
[22:32:31] World(24) = 0 | 24 != 0
[22:32:31] World(25) = 0 | 25 != 0
[22:32:31] World(26) = 0 | 26 != 0
[22:32:31] World(27) = 0 | 27 != 0
[22:32:31] World(28) = 0 | 28 != 0
[22:32:31] World(29) = 0 | 29 != 0
[22:32:31] World(30) = 0 | 30 != 0
[22:32:31] World(31) = 0 | 31 != 0
[22:32:31] World(32) = 0 | 32 != 0
[22:32:31] World(33) = 0 | 33 != 0
[22:32:31] World(34) = 0 | 34 != 0
[22:32:31] World(35) = 0 | 35 != 0
[22:32:31] World(36) = 0 | 36 != 0
[22:32:31] World(37) = 0 | 37 != 0
[22:32:31] World(38) = 0 | 38 != 0
[22:32:31] World(39) = 0 | 39 != 0
[22:32:31] World(40) = 0 | 40 != 0
[22:32:31] World(41) = 0 | 41 != 0
[22:32:31] World(42) = 0 | 42 != 0
[22:32:31] World(43) = 0 | 43 != 0
[22:32:31] World(44) = 0 | 44 != 0
[22:32:31] World(45) = 0 | 45 != 0
[22:32:31] World(46) = 0 | 46 != 0
[22:32:31] World(47) = 0 | 47 != 0
[22:32:31] World(48) = 0 | 48 != 0
[22:32:31] World(49) = 0 | 49 != 0