SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Tutorials

Reply
 
Thread Tools Display Modes
Old 08/09/2010, 11:26 AM   #21
PinkFloydLover
Gangsta
 
Join Date: Dec 2007
Location: Yes
Posts: 679
Reputation: 12
Default Re: Making a simple PM system with ZCMD & sscanf

not quite sure but try something like:
Code:
if(str2 > 128)//gets if the players message is more then the max
{
    //rest of message here
}
PinkFloydLover is offline   Reply With Quote
Old 19/09/2010, 03:53 PM   #22
gondes
Huge Clucker
 
Join Date: Jul 2010
Posts: 211
Reputation: 0
Default Re: Making a simple PM system with ZCMD & sscanf

Can you making cmd /me with color purple?
gondes is offline   Reply With Quote
Old 19/09/2010, 04:01 PM   #23
Toni
High-roller
 
Toni's Avatar
 
Join Date: Aug 2009
Location: United States
Posts: 1,493
Reputation: 156
Default Re: Making a simple PM system with ZCMD & sscanf

Quote:
Originally Posted by gondes View Post
Can you making cmd /me with color purple?
Code:
CMD:me(playerid, params[])
{
    new str[128], pName[24];
    GetPlayerName(playerid, pName, 24);
    if(sscanf(params, "s[128]", str))
	{
	    return SendClientMessage(playerid, LBLUE, "Usage: /me (action)") &&
	    SendClientMessage(playerid, ORANGE, "Function: make a me action");
	}
	format(str, sizeof(str), "* %s %s", pName, str);
	SendClientMessageToAll(PURPLE, str);
	return 1;
}
__________________
Toni is offline   Reply With Quote
Old 05/01/2011, 04:28 AM   #24
_rAped
Huge Clucker
 
_rAped's Avatar
 
Join Date: Dec 2010
Posts: 395
Reputation: 2
Default Re: Making a simple PM system with ZCMD & sscanf

You forgot to index the string in sscanf so this will flood your server with warnings.
_rAped is offline   Reply With Quote
Old 06/08/2011, 10:18 AM   #25
opik
Little Clucker
 
Join Date: May 2010
Posts: 11
Reputation: 0
Default Re: Making a simple PM system with ZCMD & sscanf

I have problem with this pm Scripts..
When i pm to id 0 - 5 its work Great, BUT, when i PM to id 6 - and bigger than id 6. the Message will Sent to id 0. anyone can help me ?
opik is offline   Reply With Quote
Old 08/06/2012, 05:12 AM   #26
mickos
High-roller
 
mickos's Avatar
 
Join Date: Apr 2012
Location: Slijterij
Posts: 1,858
Reputation: 746
Default Re: Making a simple PM system with ZCMD & sscanf

Very nice
mickos is offline   Reply With Quote
Old 14/05/2013, 10:28 PM   #27
chuck100
Big Clucker
 
Join Date: Dec 2012
Posts: 80
Reputation: -10
Default Re: Making a simple PM system with ZCMD & sscanf

Exellent Tutorial you just forgot

Quote:
if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot pm yourself!")
You forgot in the end of that line the ";"... Anyway Ty
chuck100 is offline   Reply With Quote
Old 18/05/2013, 05:10 PM   #28
Pettersen
Big Clucker
 
Pettersen's Avatar
 
Join Date: Apr 2013
Location: San Andreas
Posts: 158
Reputation: 9
Default Re: Making a simple PM system with ZCMD & sscanf

Good tut but you could have explained a bit more
But good tut.
__________________
Pettersen is offline   Reply With Quote
Old 30/10/2014, 01:59 PM   #29
ATGOggy
Gangsta
 
Join Date: Sep 2014
Location: Ls-rcr
Posts: 850
Reputation: 52
Default Re: Making a simple PM system with ZCMD & sscanf

CMDm(playerid, params[])
{
new stringpm[128],toid, toname[128];
if(sscanf(params, "us", toid, params)) SendClientMessage(playerid, COLOR_ORANGE, "Correct usage: /pm <id> <message>");
else if(!IsPlayerConnected(toid)) SendClientMessage(playerid, COLOR_ORANGE, "ERROR: Player not connected");
if(playerid == toid) SendClientMessage(playerid, COLOR_ORANGE, "ERROR: You cannot send a PM to yourself!");
else
{
GetPlayerName(toid, toname, sizeof(toname));
format(stringpm, sizeof(stringpm), "PM To %s(%d): %s", playername, toid, params);
SendClientMessage(playerid, COLOR_YELLOW, stringpm);
format(stringpm, sizeof(stringpm), "PM From %s(%d): %s", playername, playerid, params);
SendClientMessage(toid, COLOR_YELLOW, stringpm);
}
return 1;
}



I did this but I keep getting error:

E:\My Server\gamemodes\SARCR.pwn(596) : error 029: invalid expression, assumed zero
E:\My Server\gamemodes\SARCR.pwn(596) : error 017: undefined symbol "cmd_pm"
E:\My Server\gamemodes\SARCR.pwn(596) : error 029: invalid expression, assumed zero
E:\My Server\gamemodes\SARCR.pwn(596) : fatal error 107: too many error messages on one line
ATGOggy is offline   Reply With Quote
Old 30/10/2014, 02:01 PM   #30
Rudy_
High-roller
 
Rudy_'s Avatar
 
Join Date: Nov 2011
Location: Pakistan
Posts: 1,512
Reputation: 228
Default Re: Making a simple PM system with ZCMD & sscanf

Have you got Zcmd?
__________________
And now my Watch has Ended.


[Tutorial]
[TuT]How to create a car shooting Neon

[Filterscript]
Neon Vehicle Laser


__________________________________________________
Rudy_ is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ZCMD/SSCANF PROBLEM Zeromanster Help Archive 2 27/02/2010 11:26 PM
Simple ZCMD Tutorial Script (.Aztec); Filterscripts 5 13/01/2010 12:58 AM
ZCMD + SSCANF PROBLEM Zeromanster Help Archive 6 22/11/2009 01:13 AM
sscanf and zcmd question about commands with multi parameters Dujma Help Archive 5 21/11/2009 01:24 AM
[Help]Zcmd & sscanf Dirty_bum Help Archive 3 28/10/2009 12:10 PM


All times are GMT. The time now is 10:03 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.