SA-MP Forums Archive
name entered dm - 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: name entered dm (/showthread.php?tid=218938)



name entered dm - hadzx - 31.01.2011

what would the code be for when you type a cmd it says


your name entered dildo dm

example


Код:
%S Entered Dildo DM!
and it sents it to everybody connected thank you:P


Re: name entered dm - YungGee - 31.01.2011

Under OnPlayerConnect put:

pawn Код:
new string[128];
                new playername[MAX_PLAYER_NAME];
        GetPlayerName(playerid,playername,sizeof(playername));
        format(string,128,"%s Entered Dildo DM",playerid);
        SendClientMessage(playerid, COLOR, string);//Change COLOR to your Color Define
EDIT: String + Typo


Re: name entered dm - Mike Garber - 31.01.2011

This code is better optimized and won't waste almost 100 character long string
in your servers memory. You can make It 18 characters longer without problems now,
but If you want a longer string just change the "+48" to a higher number.

pawn Код:
new str[MAX_PLAYER_NAME+48],pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
format(str,sizeof(str),"%s has entered the Dildo DM area",pname);
SendClientMessageToAll(playerid,-1,str);



Re: name entered dm - hadzx - 31.01.2011

Quote:
Originally Posted by YungGee
Посмотреть сообщение
Under OnPlayerConnect put:

pawn Код:
new string[128];
                new playername[MAX_PLAYER_NAME];
        GetPlayerName(playerid,playername,sizeof(playername));
        format(string,128,"%s Entered Dildo DM",playerid);
        SendClientMessage(playerid, COLOR, string);//Change COLOR to your Color Define
EDIT: String + Typo
it says m Entered Dildo DM


help plz


Re: name entered dm - hadzx - 31.01.2011

Quote:
Originally Posted by Mike Garber
Посмотреть сообщение
This code is better optimized and won't waste almost 100 character long string
in your servers memory. You can make It 18 characters longer without problems now,
but If you want a longer string just change the "+48" to a higher number.

pawn Код:
new str[MAX_PLAYER_NAME+48],pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
format(str,sizeof(str),"%s has entered the Dildo DM area",pname);
SendClientMessageToAll(playerid,-1,str);
Код:
new str[MAX_PLAYER_NAME+48],pname[MAX_PLAYER_NAME];
			GetPlayerName(playerid,pname,sizeof(pname));
			format(str,sizeof(str),"%s has entered the Dildo DM area",pname);
			SendClientMessageToAll(playerid,-1,str);
got these errors


Код:
C:\Users\Stephen-Laptop\Desktop\server samp - Copy\gamemodes\lvpg.pwn(1060) : error 035: argument type mismatch (argument 2)
C:\Users\Stephen-Laptop\Desktop\server samp - Copy\gamemodes\lvpg.pwn(1062) : error 017: undefined symbol "string"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.



Re: name entered dm - Mike Garber - 31.01.2011

Lol that has nothing to do with my code, It doesn't even have "string" in it...


Re: name entered dm - hadzx - 31.01.2011

dw fixed i had the code wrote down thanks tho