Lil' script prob
#1

Sup guys,
I was creating a /aduty command for my cops and robber server,
but the playername isnt giving


Код:
ADMIN [Playername] is now [OFF] admin duty
String :
No errors.
Код:
format(string, 200, "ADMIN %s(%d) is now [OFF] admin duty", pname, playerid);
Ingame :

It isnt giving the name of the admin :S

Full command :

Код:
cmd(aduty, playerid, params[])

{
    new ID; new string[120]; new pname[240];
	if(GetPVarInt(playerid, "AdminLevel") == 0) return 0;
	if(GetPVarInt(playerid, "AdminMode") == 1)
	{
	    SetPlayerHealth(playerid, 100);
		SetPlayerArmour(playerid, 100);
		ResetPlayerWeapons(playerid);
		GivePlayerTeamWeapons(playerid);
		SetPlayerColor(playerid, 0xFAFAFAFF);
		SetPlayerSkin(playerid, 115);
        format(string, 200, "ADMIN %s(%d) is now [OFF] admin duty", pname, playerid);
		SendClientMessageToAll(COLOR_ADMIN, string);
		SetPVarInt(playerid, "AdminMode", 0);
		return 1;
	}
Hope you guys can help me
Reply
#2

Remove this one wtf why did i double post ?
Reply
#3

maybe:
pawn Код:
cmd(aduty, playerid, params[])
{
new ID; new string[120]; new pname[24];
if(GetPVarInt(playerid, "AdminLevel") == 0) return 0;
if(GetPVarInt(playerid, "AdminMode") == 1)
{
GetPlayerName(playerid, pname, sizeof(pname));
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
ResetPlayerWeapons(playerid);
GivePlayerTeamWeapons(playerid);
SetPlayerColor(playerid, 0xFAFAFAFF);
SetPlayerSkin(playerid, 115);
format(string, 200, "ADMIN %s(%d) is now [OFF] admin duty", pname, playerid);
SendClientMessageToAll(COLOR_ADMIN, string);
SetPVarInt(playerid, "AdminMode", 0);
return 1;
}
?
Reply
#4

THanks it works !
Reply
#5

lol you were just getting the playerid because you set it to get the playerid instead of the name.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)