Command problem +rep - 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)
+--- Thread: Command problem +rep (
/showthread.php?tid=332873)
Command problem +rep -
RaulSTARs - 09.04.2012
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
Код:
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;
}
Re: Command problem +rep -
ViniBorn - 09.04.2012
Replace
pawn Код:
format(string, sizeof(string), "* %d offerd %s to have Sex , for $%d.", sendername, giveplayer, money);
pawn Код:
format(string, sizeof(string), "* %s offerd %s to have Sex , for $%d.", sendername, giveplayer, money);
Re: Command problem +rep -
RaulSTARs - 09.04.2012
I will try now.
I will edit if work/not
Thank you! Work! +rep
Re: Command problem +rep -
Jeffry - 09.04.2012
And change
pawn Код:
printf("%d offered to %s to have sex for $%s", sendername, giveplayer, money);
to
.