SA-MP Forums Archive
A few questions. - 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: A few questions. (/showthread.php?tid=177103)



A few questions. - SampStunta - 16.09.2010

Here are a few questions...

How do I teleport ALL players to Area51?
How do I set ALL players into 2 teams?

Thank you!


Re: A few questions. - Arrows73 - 16.09.2010

1.
Код:
for (new i= 0; i<MAX_PLAYERS; i++)
{
SetPlayerPos(i, <InsertChiliadX>, <InsertChiliadY>, <InsertChiliadZ>);
<if you want>
SetPlayerFacingAngle(i, <angle>);
}
2.
https://sampwiki.blast.hk/wiki/PAWN_tuto...eam_deathmatch


Re: A few questions. - SampStunta - 16.09.2010

What am I doing wrong here?
Код:
#include <a_samp>
#define TEAM_GANG 0
#define TEAM_LSPD 1
new gTeam[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp("/startevent", cmdtext, true))
    {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
               for (new i= 0; i<MAX_PLAYERS; i++)
             {
                SetPlayerPos(i, 245,3445, 1862,654 , 18,02273 );
                PlayerPlaySound(i,1057,0.0,0.0,0.0);
                GivePlayerWeapon(i,31,350);
                GivePlayerWeapon(i,24,350);
                GivePlayerWeapon(i,26,350);
                GivePlayerWeapon(i,27,350);

        }
        return 1;
 }
    return 0;
}
And this is the Error:
Код:
E:\Program Files\Rockstar Games\GTA San Andreas\pawno\event.pwn(13) : warning 219: local variable "i" shadows a variable at a preceding level
E:\Program Files\Rockstar Games\GTA San Andreas\pawno\event.pwn(15) : warning 202: number of arguments does not match definition
E:\Program Files\Rockstar Games\GTA San Andreas\pawno\event.pwn(15) : warning 202: number of arguments does not match definition
E:\Program Files\Rockstar Games\GTA San Andreas\pawno\event.pwn(15) : warning 202: number of arguments does not match definition
E:\Program Files\Rockstar Games\GTA San Andreas\pawno\event.pwn(23) : warning 217: loose indentation
E:\Program Files\Rockstar Games\GTA San Andreas\pawno\event.pwn(25) : warning 217: loose indentation
E:\Program Files\Rockstar Games\GTA San Andreas\pawno\event.pwn(27) : error 030: compound statement not closed at the end of file (started at line 9)
Pawn compiler 3.2.3664              Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: A few questions. - Retardedwolf - 16.09.2010

pawn Код:
#include <a_samp>
#define TEAM_GANG 0
#define TEAM_LSPD 1
new gTeam[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp("/startevent", cmdtext, true))
    {
        for (new ii= 0; ii<MAX_PLAYERS; ii++)
        {
            if(IsPlayerConnected(i))
            {
                SetPlayerPos(i, 245,3445, 1862,654 , 18,02273 );
                PlayerPlaySound(i,1057,0.0,0.0,0.0);
                GivePlayerWeapon(i,31,350);
                GivePlayerWeapon(i,24,350);
                GivePlayerWeapon(i,26,350);
                GivePlayerWeapon(i,27,350);
                }

        return 1;
 }
    return 0;
}



Re: A few questions. - SampStunta - 16.09.2010

Thank you.


Re: A few questions. - SampStunta - 16.09.2010

Sorry for double post, but when RetardedWolf gave me that code it is now 8 errors and he didn't fix my error.

Please help somebody!


Re: A few questions. - Retardedwolf - 17.09.2010

Код:
#include <a_samp>
#define TEAM_GANG 0
#define TEAM_LSPD 1
new gTeam[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp("/startevent", cmdtext, true))
    {
        for (new i= 0; i<MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                SetPlayerPos(i, 245,3445, 1862,654 , 18,02273 );
                PlayerPlaySound(i,1057,0.0,0.0,0.0);
                GivePlayerWeapon(i,31,350);
                GivePlayerWeapon(i,24,350);
                GivePlayerWeapon(i,26,350);
                GivePlayerWeapon(i,27,350);
                }
        }
        return 1;
    }
    return 0;
}
I'm not sure if it will work or not.


Re: A few questions. - SampStunta - 17.09.2010

Yes, it worked. Thank you