Little help
#1

I would like to make /pay command for RP server using ProxDetector, can you help me
Format + Prox Detector
Код:
ProxDetector(40.0, playerid, str, COLOR_ACTION,COLOR_ACTION,COLOR_ACTION,COLOR_ACTION,COLOR_ACTION);
It must send message to all players (40 meters near), * [Name_Lastname] takes out some money and gave it to [Name_Lastname] *
and to the SendClientMessage to the guy who get the money
You received [amout of money] from [Name Lastname].
Thanks.
Reply
#2

Use IsPlayerInRangeOfPoint. https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
Reply
#3

What is wrong with that command
Код:
if(!strcmp(cmdtext, "/enter", true))
    {
    if(IsPlayerInRangeOfPoint(playerid, 2.0, -1390.1477,2638.7412,55.9844))
	{
    SetPlayerPos(playerid, 246.7830,63.9027,1003.6406);
    SetPlayerFacingAngle(playerid, 0.0000);
    SetPlayerInterior(playerid, 10);
    return 1;
    }
Reply
#4

It should be;
pawn Код:
if(!strcmp(cmdtext, "/enter", true))
{
    if(IsPlayerInRangeOfPoint(playerid, 2.0, -1390.1477,2638.7412,55.9844))
    {
        SetPlayerPos(playerid, 246.7830,63.9027,1003.6406);
        SetPlayerFacingAngle(playerid, 0.0000);
        SetPlayerInterior(playerid, 10);
        return 1;
    }
}
Reply
#5

Quote:
Originally Posted by Anzhelov
Посмотреть сообщение
I would like to make /pay command for RP server using ProxDetector, can you help me
Format + Prox Detector
Код:
ProxDetector(40.0, playerid, str, COLOR_ACTION,COLOR_ACTION,COLOR_ACTION,COLOR_ACTION,COLOR_ACTION);
It must send message to all players (40 meters near), * [Name_Lastname] takes out some money and gave it to [Name_Lastname] *
and to the SendClientMessage to the guy who get the money
You received [amout of money] from [Name Lastname].
Thanks.
So with the /pay command, can someone help me ?
Reply
#6

@OP I'm doing it.
Reply
#7

pawn Код:
CMD:pay(playerid, params[])
{
    new giveplayerid, gamount, name1, name2, Float:X,Float:Y,Float:Z;
    if(sscanf,"ui",giveplayerid, gamount) return SendClientMessage(playerid, 0xFF0000, "USAGE: /pay [PlayerID/PartofName] [Amount]");
    if(GetPlayerMoney(playerid) < gamount) return SendClientMessage(playerid,0xFF0000, "You do not have that amount of money.");
    if(giveplayerid = INVALID_PLAYER_ID) return SendClientMessage(playerid,0xFF0000, "The player ID/Name entered is INVALID.");
    GetPlayerName(playerid, name1, sizeof(name1));
    GetPlayerName(giveplayerid, name2, sizeof(name2));
    GetPlayerPos(playerid,X,Y,Z);
    foreach(Player, i)
    {
        If(IsPlayerInRangeOfPoint(i,40.0,X,Y,Z)
        {
            new msg[128];
            format(msg,sizeof(msg),"%s takes out some money and gives it to %s", name1, name2);
            SendClientMessage(i,0xD900FF,msg);
            new msg2[100];
            format(msg2,sizeof(msg2),"You have recieved $%i from %s", gamount, name1);
            SendClientMessage(giveplayerid, 0xFFFFFF, msg2);
            return 1;
        }
    }
    return 1;
}
Make sure you include foreach, zcmd and sscanf2.
Reply
#8

Notice that I did not use ProxDetector, I myself never liked it, It may be shorter but it confuses me, I'd rather use IsPlayerInRangeOfPoint.
Reply
#9

Quote:
Originally Posted by funky1234
Посмотреть сообщение
It should be;
pawn Код:
if(!strcmp(cmdtext, "/enter", true))
{
    if(IsPlayerInRangeOfPoint(playerid, 2.0, -1390.1477,2638.7412,55.9844))
    {
        SetPlayerPos(playerid, 246.7830,63.9027,1003.6406);
        SetPlayerFacingAngle(playerid, 0.0000);
        SetPlayerInterior(playerid, 10);
        return 1;
    }
}
No, it should be:
pawn Код:
if(!strcmp(cmdtext, "/enter", true))
{
    if(IsPlayerInRangeOfPoint(playerid, 2.0, -1390.1477,2638.7412,55.9844))
    {
        SetPlayerPos(playerid, 246.7830,63.9027,1003.6406);
        SetPlayerFacingAngle(playerid, 0.0000);
        SetPlayerInterior(playerid, 10);
    }
    return 1;
}
Reply
#10

Код:
D:\Games\Grand Theft Auto (GTA) San Andreas-HOODLUM\ROLE FUCKING PLAY\gamemodes\VRP.pwn(5) : fatal error 100: cannot read from file: "foreach"

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply


Forum Jump:


Users browsing this thread: