SA-MP Forums Archive
/changeteam - 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: /changeteam (/showthread.php?tid=260732)



/changeteam - marwan - 10.06.2011

how to make a /changeteam with normal strcmp i tried it didn't work it just say Team change costed you $10000 here is the cmd
Код:
if(!strcmp(cmdtext, "/changeteam", true, 11))
	{
    SendClientMessage(playerid, BLUE, "Team change costed you $10000");
    GivePlayerMoney(playerid, -10000);
	ForceClassSelection(playerid);
	return 1;
	}



Re: /changeteam - Wesley221 - 10.06.2011

I think you need to die first to change your class
pawn Код:
if(!strcmp(cmdtext, "/changeteam", true, 11))
{
    SendClientMessage(playerid, BLUE, "Team change costed you $10000");
    GivePlayerMoney(playerid, -10000);
    SetPlayerHealth(playerid, -50);
    ForceClassSelection(playerid);
    return 1;
}



Re: /changeteam - Mike Garber - 10.06.2011

No there's no reason for setting the health to -50.
Also READ the WIKI and you wouldn't have to create this topic...

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


Re: /changeteam - randomkid88 - 10.06.2011

What Mike was saying with the link is that you have to kill the person AFTER using ForceClassSelection. Hence the link to the wiki where it explains that.


Re: /changeteam - marwan - 11.06.2011

ok thank you al for helping i forgot that