Help! showing the player name
#1

Dear all

i have today a lot of questions
in this case i wanted since a long time a that;
so, this code work nice! but how you see this show
a message to all "Some Admin Just Joined in 4 Mansion's Admin Zone /az"
and my head is broken trying to put in there
example:

Martini002 Just Joined in 4 Mansion's Admin Zone /az"

a name of the player using the command =/
and other thing, i can use this /az command only when im in a car :S
if am not in a car then server show me, the command do not exist

i appreciate very much your helps guys
thanks

Код:
CMD:az(playerid,params[]) {
    if(PlayerInfo[playerid][Level] >= 4 || IsPlayerAdmin(playerid)) {
		if(PlayerInfo[playerid][Jailed] == 1) return SendClientMessage(playerid,COLOR_BRIGHTRED,"You cannot escape your punishment!");

		CarSpawner(playerid,0);
		TeleTimer[playerid] = SetTimerEx("ttimer", 1000, true, "i",playerid);
		tseconds[playerid] = 3;
		format(tstring,45,"You Must wait %d seconds before teleporting", tseconds[playerid]-1);
		if(PlayerInfo[playerid][Level] >= 1) SendClientMessage(playerid,COLOR_LIGHTBLUE, tstring);
		vCount[playerid] = 1;
		Tx[playerid] = -921.010301;
		Ty[playerid] = 536.524665;
		Tz[playerid] = 6.936157;
		Ti[playerid] = 0;
		if(PlayerInfo[playerid][Level] >=4) {
			for(new v=0;v<MAX_VEHICLES;v++) if(!IsVehicleOccupied(v)) EraseVehicle(v);
		}
		format(telestring,43,"Welcome to 4 Mansion's Admin Zone");
		SetTimerEx("setstunt",3000,0,"i", playerid);
		SendClientMessageToAll(COLOR_YELLOW,"Some Admin Just Joined in 4 Mansion's Admin Zone /az");
		return 1;
	} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}
Reply
#2

I can't understand, what you mean, but maybe that :
pawn Код:
CMD:az(playerid,params[]) {
    if(PlayerInfo[playerid][Level] >= 4 || IsPlayerAdmin(playerid)) {
        if(PlayerInfo[playerid][Jailed] == 1) return SendClientMessage(playerid,COLOR_BRIGHTRED,"You cannot escape your punishment!");
        CarSpawner(playerid,0);
        TeleTimer[playerid] = SetTimerEx("ttimer", 1000, true, "i",playerid);
        tseconds[playerid] = 3;
        format(tstring,45,"You Must wait %d seconds before teleporting", tseconds[playerid]-1);
        if(PlayerInfo[playerid][Level] >= 1) SendClientMessage(playerid,COLOR_LIGHTBLUE, tstring);
        vCount[playerid] = 1;
        Tx[playerid] = -921.010301;
        Ty[playerid] = 536.524665;
        Tz[playerid] = 6.936157;
        Ti[playerid] = 0;
        if(PlayerInfo[playerid][Level] >=4) {
            for(new v=0;v<MAX_VEHICLES;v++) if(!IsVehicleOccupied(v)) EraseVehicle(v);
        }
        new PlayerName[MAX_PLAYER_NAME];
        GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
        SendClientMessageToAll(COLOR_YELLOW,"%s Just Joined in 4 Mansion's Admin Zone /az",PlayerName);
        format(telestring,43,"Welcome to 4 Mansion's Admin Zone");
        SetTimerEx("setstunt",3000,0,"i", playerid);
        SendClientMessageToAll(COLOR_YELLOW,"Some Admin Just Joined in 4 Mansion's Admin Zone /az");
        return 1;
    } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}
But that is only with that name, with that vehicle i need to think !

I think delete that :
pawn Код:
for(new v=0;v<MAX_VEHICLES;v++) if(!IsVehicleOccupied(v)) EraseVehicle(v);
        }
and try. If that dont work, try to add there that :
pawn Код:
if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid,RED,"You are in car");
Reply
#3

well, i understand what you mean
so i want this

in the line:
SendClientMessageToAll(COLOR_YELLOW,"Some Admin Just Joined in 4 Mansion's Admin Zone /az");
that print "Some Admin Just Joined in 4 Mansion's Admin Zone /az" right?
so i want thats print
Martini002 Just Joined in 4 Mansion's Admin Zone /az or any other player that was using this command
Reply
#4

pawn Код:
print("\n%s Just Joined in 4 Mansion's Admin Zone /az",GetName(playerid));
You think that ?
Reply
#5

ill test it right now wait, hmmm but this print in the chat box or in the middle of the screen?
Reply
#6

Quote:
Originally Posted by Gertin
Посмотреть сообщение
pawn Код:
print("\n%s Just Joined in 4 Mansion's Admin Zone /az",GetName(playerid));
You think that ?
Use printf.

Quote:
Originally Posted by martini002
ill test it right now wait, hmmm but this print in the chat box or in the middle of the screen?
In the RCON console.
Reply
#7

well not work =/ so with printf will work only for admins or other players too?
Reply
#8

Quote:
Originally Posted by martini002
Посмотреть сообщение
well not work =/ so with printf will work only for admins or other players too?
printf() prints a message in the RCON console with a formated string.
Reply
#9

Код:
SATDM\SAMP 0.3b\Gamemodes\SATDM_v10.pwn(50637) : warning 202: number of arguments does not match definition
SATDM\SAMP 0.3b\Gamemodes\SATDM_v10.pwn(50637) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
Код:
50637 		printf("\n%s Just Joined in 4 Mansion's Admin Zone /az",GetPlayerName(playerid));
=(
Reply
#10

pawn Код:
Use GetName(playerid), not GetPlayerName(playerid)
Reply
#11

pawno say to me, the symbol is not defined
Reply
#12

EDIT:
pawn Код:
new PlayerName[MAX_PLAYER_NAME], tstring[126];
GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
printf("\n%s (ID:%d) Just Joined in 4 Mansion's Admin Zone /az!",PlayerName,playerid);
format(tstring,sizeof(tstring),"%s (ID:%d) Just Joined in 4 Mansion's Admin Zone /az!",PlayerName,playerid);
SendClientMessageToAll(COLOR_YELLOW,tstring);
Reply
#13

thanks guys seriusly, i appreciate much, your time and your help, but this only show in rcon console, and not in the game, and i want the other guys, see that other player just joined in there, if we can do it, then ill apply it in all my commands
Reply
#14

check my edited post...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)