SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 09/04/2012, 04:57 PM   #1
RaulSTARs
Big Clucker
 
Join Date: Jul 2010
Posts: 104
Reputation: 0
Default Command problem +rep

Hello Everybody.

I have an problem at /sex command , because i want to do an Log to see who try to cheat , like /sex newacccount PRICE many times , and I did an log. But in Log doesen't appear sendername , appear 82. Like in this screen :
The Yellow part is the ABroadcast , to appear at admin , but you can see appear 82 not the sendername (Me)

The /sex code is

Code:
	if(strcmp(cmd, "/sex", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	   	{
	        if(PlayerInfo[playerid][pJob] == 3)
			{
			    if(!IsPlayerInAnyVehicle(playerid))
			    {
					SendClientMessage(playerid, COLOR_GREY, "   You can only have Sex in a Car !");
					return 1;
			    }
			    GetPlayerName(playerid, sendername, sizeof(sendername));
			    new Car = GetPlayerVehicleID(playerid);
				tmp = strtok(cmdtext, idx);
				if(!strlen(tmp))
				{
					SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /sex [playerid/PartOfName] [price]");
					return 1;
				}
				//giveplayerid = strval(tmp);
				giveplayerid = ReturnUser(tmp);
				tmp = strtok(cmdtext, idx);
				new money;
				money = strval(tmp);
				if(money < 1 || money > 99999) { SendClientMessage(playerid, COLOR_GREY, "   Price not lower then 1, or above 99999!"); return 1; }
				if(IsPlayerConnected(giveplayerid))
				{
				    if(giveplayerid != INVALID_PLAYER_ID)
				    {
						if (ProxDetectorS(8.0, playerid, giveplayerid))
						{
						    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot have Sex with yourself!"); return 1; }
						    if(IsPlayerInAnyVehicle(playerid) && IsPlayerInVehicle(giveplayerid, Car))
						    {
								GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
								GetPlayerName(playerid, sendername, sizeof(sendername));
								format(string, sizeof(string), "* You offerd %s to have Sex with you, for $%d.", giveplayer, money);
								SendClientMessage(playerid, COLOR_WHITE, string);
								format(string, sizeof(string), "* Whore %s has offerd you to have Sex with her, for $%d (type /accept sex) to accept.", sendername, money);
								SendClientMessage(giveplayerid, COLOR_WHITE, string);
					            SexOffer[giveplayerid] = playerid;
					            SexPrice[giveplayerid] = money;
								format(string, sizeof(string), "* %d offerd %s to have Sex , for $%d.", sendername,	giveplayer, money);
								SexLog(string);
								printf("%d offered to %s to have sex for $%s",	sendername,	giveplayer,	money);
								ABroadCast(COLOR_YELLOW,string,1);

				            }
				            else
				            {
				                SendClientMessage(playerid, COLOR_GREY, "   You or the other player must be in a Car together !");
				                return 1;
				            }
						}
						else
						{
							SendClientMessage(playerid, COLOR_GREY, "   That player is not near you !");
							return 1;
						}
					}
				}
				else
				{
					SendClientMessage(playerid, COLOR_GREY, "   That player is offline !");
					return 1;
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY, "   You are not a Whore !");
			}
		}//not connected
		return 1;
		}
RaulSTARs is offline   Reply With Quote
Old 09/04/2012, 05:02 PM   #2
ViniBorn
Godfather
 
ViniBorn's Avatar
 
Join Date: Aug 2010
Location: Brasília
Posts: 5,015
Reputation: 629
Default Re: Command problem +rep

Replace

pawn Code:
format(string, sizeof(string), "* %d offerd %s to have Sex , for $%d.", sendername, giveplayer, money);

pawn Code:
format(string, sizeof(string), "* %s offerd %s to have Sex , for $%d.", sendername, giveplayer, money);
__________________
ViniBorn is offline   Reply With Quote
Old 09/04/2012, 05:04 PM   #3
RaulSTARs
Big Clucker
 
Join Date: Jul 2010
Posts: 104
Reputation: 0
Default Re: Command problem +rep

I will try now.

I will edit if work/not

Thank you! Work! +rep
RaulSTARs is offline   Reply With Quote
Old 09/04/2012, 05:04 PM   #4
Jeffry
High-roller
 
Jeffry's Avatar
 
Join Date: Oct 2009
Location: Germany
Posts: 1,572
Reputation: 61
Default Re: Command problem +rep

And change
pawn Code:
printf("%d offered to %s to have sex for $%s",  sendername, giveplayer, money);
to
pawn Code:
print(string);
.
__________________


Jeffry 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
Command problem(gate command) pliptm Help Archive 0 01/06/2011 05:35 PM
Command Problem need help :( wofka13 Help Archive 0 24/06/2010 08:26 PM
HELP : Which is the problem with this command?? linthebigs Help Archive 3 24/05/2009 09:13 PM
problem with command /ram dlc Help Archive 2 02/05/2009 10:51 AM


All times are GMT. The time now is 09:51 AM.


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