SA-MP Forums Archive
Check point - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Check point (/showthread.php?tid=85039)



Check point - Indi Corrozo - 04.07.2009

Ok so a checkpoint is added when /drop H-bomb is typed in, But it only apear's on that one persons screen, how can i make it go to everyong? er Sync?
Quote:

if(strcmp(cmdtext, "/drop H-bomb", true) == 0)
{
if(GetPlayerTeam(playerid) == 1) {
if(Nuking)
{
SendClientMessage(playerid,RED,"There is already a nuke planted.");
return 1;
}
if(GetPlayerSkin(playerid) == 285) {
SetPlayerCheckpoint(playerid, 316.0695,1037.8270,1944.0531,5.0);
SendClientMessageToAll(RED, "KILL THE SURVIVORS!");
}
//rest of the code is here



Re: Check point - 6tynine - 04.07.2009

SetPlayerCheckpoint(playerid, thats why you have playerid, so its gonna show for 1 person who does that command.


Re: Check point - Indi Corrozo - 04.07.2009

ah right, so how could i make it show up for everyone? with a loop? for the player id? er something


Re: Check point - 6tynine - 04.07.2009

Search around. Im not sure about it. try -1


Re: Check point - member - 04.07.2009

Simple as a loop.

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
            {
                DisablePlayerCheckpoint(i);
                SetPlayerCheckpoint(i,x, y, z,CPSize);
            }



Re: Check point - Indi Corrozo - 04.07.2009

if(GetPlayerSkin(playerid) == 285) {
new i = 0;
new allplayers = i < MAX_PLAYERS;
SetPlayerCheckpoint(allplayers, 316.0695,1037.8270,1944.0531,5.0);
SendClientMessageToAll(RED, "KILL THE SURVIVORS!");
}
so i made that loop, would that work?
edit;
Didnt see the one above
Quote:
Originally Posted by [B2K
Hustler ]
Simple as a loop.

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
            {
                DisablePlayerCheckpoint(i);
                SetPlayerCheckpoint(i,x, y, z,CPSize);
            }
Ill try that


Re: Check point - member - 04.07.2009

no that wont, give me 1 minute and i'll give u the correct way.

EDIT:

pawn Код:
if(strcmp(cmdtext, "/drop H-bomb", true) == 0)
{
    if(GetPlayerTeam(playerid) == 1)
    {
        if(Nuking) return SendClientMessage(playerid,RED,"There is already a nuke planted.");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(GetPlayerSkin(i) == 285)
            {
              DisablePlayerCheckpoint(i);
                SetPlayerCheckpoint(i, 316.0695,1037.8270,1944.0531,5.0);
                SendClientMessageToAll(RED, "KILL THE SURVIVORS!");
                //rest of the code is here (for skin id 285 players
            }
        }
    }
    return 1;
}



Re: Check point - Indi Corrozo - 04.07.2009

thanks