Team commands and more
#1

hello all.

I got 2 questiones:

1. When a player spawns he will chose if he wants to be engineer, pilot, assult or sniper in dialog, i know how to make that, but i want to make when a player choses pilot it will attach a 3D text to his head (over his head) and when he diies he wont chose the class anymore (Engineer, Pilot etc...) and a chat for only Army and only Terrorsists (like /a for army, /t for terrorists)

2. How can i make commands for teams only (like /m4 for army only, /ak for terrorists [example])

Thanks for any help, soon my server will be hosted (not home) and the one who helps me now will get /credits. (if someone cares about that)
Reply
#2

please someone help me
Reply
#3

Your first question..
1.if you did anything like this ..

pawn Код:
public OnPlayerRequestClass(playerid, classid)
    {
    switch (classid)
    {
        case 0:
        {
            SetPlayerPos(playerid, 1541.1511,-932.8580,43.1303);
            SetPlayerFacingAngle(playerid, 4.9192);
            SetPlayerCameraPos(playerid, 1540.8115,-926.4645,43.0597);
            SetPlayerCameraLookAt(playerid, 1541.1511,-932.8580,43.1303);
        }
    }
    return 1;
}
then add this..

pawn Код:
GameTextForPlayer(playerid, "~g~~h~BMXer", 1500, 6);
you can change "BMXer" according to your wish

Your second question
2.Use gTeam and make commands for each team.
here is the samp wiki for more informations
https://sampwiki.blast.hk/wiki/PAWN_tutorial
Reply
#4

2. // at OnPlayerCommandText
Код:
dcmd(m4, 2, cmdtext);
dcmd(ak, 2, cmdtext);
// Put at bottom of script
Код:
dcmd_m4(playeri, params[])// Command for cops
{
	#pragma unused params
	if(gTeam == TEAM_COPS) {
		GivePlayerWeapon(playerid, 31);
	}
	return 1;
}
Код:
dcmd_ak(playeri, params[])// Command for terrorists
{
	#pragma unused params
	if(gTeam == TEAM_TERRORIST) {
		GivePlayerWeapon(playerid, 30);
	}
	return 1;
}
Reply
#5

Thanks thats what i wanted!
Reply
#6

you are welcome
Reply
#7

And BTW how to make it like if army does /copshelp it giives him a message like: You arent a cop! :P
Reply
#8

Put this in OnPlayerCommandText
Quote:

dcmd(copshelp, 2, cmdtext);

and put this after
Quote:

dcmd_copshelp(playeri, params[])
{
#pragma unused params
if(gTeam == TEAM_COPS)
{
GivePlayerWeapon(playerid, 30);
}
else
{
GameTextForPlayer(playerid, "~w~You're not allowed to use this command", 1500, 6);
}
return 1;
}

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)