[SOLVED]
#1

Am I doing something wrong here?
Because this doesn't work ingame :S
pawn Код:
dcmd_setteam(playerid, params[])
{
    new target, targetteam;
  if (sscanf(params, "ud", target, targetteam)) SendClientMessage(playerid, COLOR_GREY, "* Usage: '/setteam [playerid] [team]'");
  else if(gTeam[playerid] != 1) return SendClientMessage(playerid, COLOR_GREY, "* Admins only!");
    else
    {
    gTeam[target] = targetteam;
    }
  return 1;
}
Reply
#2

Code should be right.
Reply
#3

Hmm it doesnt set my team right
Reply
#4

pawn Код:
dcmd_setteam(playerid, params[])
{
    new target, targetteam;
     if (sscanf(params, "ud", target, targetteam)) SendClientMessage(playerid, COLOR_GREY, "* Usage: '/setteam [playerid] [team]'");
    else
    {
      if(IsPlayerAdmin(playerid))
      {
        gTeam[target] = targetteam;
      }
    }
     return 1;
}
Reply
#5

Hmm I printed target and targetteam and targetteam always seems to be 0 ?
Reply
#6

Try with using the latest sscanf

https://sampwiki.blast.hk/wiki/Sscanf
Reply
#7

That worked.
Thanks all!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)