SA-MP Forums Archive
[SOLVED] - 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: [SOLVED] (/showthread.php?tid=124979)



[SOLVED] - Rzzr - 01.02.2010

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



Re: Am I doing something wrong here? - MadeMan - 01.02.2010

Code should be right.


Re: Am I doing something wrong here? - Rzzr - 01.02.2010

Hmm it doesnt set my team right


Re: Am I doing something wrong here? - Mr L - 01.02.2010

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



Re: Am I doing something wrong here? - Rzzr - 01.02.2010

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


Re: Am I doing something wrong here? - MadeMan - 01.02.2010

Try with using the latest sscanf

https://sampwiki.blast.hk/wiki/Sscanf


Re: Am I doing something wrong here? - Rzzr - 01.02.2010

That worked.
Thanks all!