Need help plz Help +Reply
#1

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;

Reply
#2

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

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;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)