SA-MP Forums Archive
Need help plz Help +Reply - 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: Need help plz Help +Reply (/showthread.php?tid=526811)



Need help plz Help +Reply - MBilal - 19.07.2014

I make A CMD to get Team 1, Players to my location and save There spawn for Event but it dont work ,sometime it get players but not all players of team 1 + Event spawing save not working properly
PHP Code:
CMD:getteam1(playerid,params[])
{
    if(
Player[playerid][pAdmin] >= 3)
    {
    new 
Float:,Float:xFloat:yFloat:z;
    
GetPlayerPos(playeridxyz);
    foreach (
Playeri)
    {
    if(
gTeam[i] == TEAM_1)
    {
     
SetPlayerPos(i,x,y+2,z);
    
SetPlayerInterior(i,GetPlayerInterior(playerid));
    
GetPlayerPos(ixyz);
     
GetPlayerFacingAngle(i,a);
     
Player[i][pa]=a;
    
Player[i][px1]=x;
    
Player[i][py1]=y;
    
Player[i][pz1]=z;
    
Player[i][pevent]=1;
    }
    }
    }
    else
     {
     
SendClientMessage(playeridCOLOR_KRED"You need level 3 admin to use this cmd!");
      }
      return 
1;




Re: Need help plz Help +Reply - AIped - 19.07.2014

I cant see why you wont get all players but for saving them to that position its best to use SetSpawnInfo


Re: Need help plz Help +Reply - ScripteRNaBEEL - 19.07.2014

now try it
pawn Code:
CMD:getteam1(playerid,params[])
{
    if(Player[playerid][pAdmin] >= 3)
    {
        new Float:a ,Float:x, Float:y, Float:z;
        GetPlayerPos(playerid, x, y, z);
        foreach (Player, i)
        {
            if(gTeam[i] == TEAM_1)
            {
                SetPlayerPos(i,x,y+2,z);
                SetPlayerInterior(i,GetPlayerInterior(playerid));
                GetPlayerPos(i, x, y, z);
                GetPlayerFacingAngle(i,a);
                Player[i][pa]=a;
                Player[i][px1]=x;
                Player[i][py1]=y;
                Player[i][pz1]=z;
                Player[i][pevent]=1;
            }
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_KRED, "You need level 3 admin to use this cmd!");
    }
    return 1;
}