ProxDetector(40.0, playerid, str, COLOR_ACTION,COLOR_ACTION,COLOR_ACTION,COLOR_ACTION,COLOR_ACTION);
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; }
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;
}
}
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); and to the SendClientMessage to the guy who get the money You received [amout of money] from [Name Lastname]. Thanks. |
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;
}
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;
}
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.