CMD:pay(playerid, params[])
{
new id, money, sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], string[128];
if(sscanf(params,"ii", id, money)) return SCM(playerid, COLOR_LIGHTRED,"[D-RP]: {FFFFFF}/pay [playerid/partofname] [ammount]");
if(money < 1 || money > 100000) return SendClientMessage(playerid, COLOR_LIGHTRED,"[D-RP]: {FFFFFF}You can't pay less than $1 or more than $100,000.");
if(ProxDetector(5.0, playerid, id)) return SCM(playerid, COLOR_LIGHTRED,"[D-RP]: {FFFFFF}You are too far away from that player".);
else
{
GetPlayerName(id, name, sizeof(name));
GetPlayerName(playerid, sendername, sizeof(sendername));
new pmoney = GetPlayerMoney(playerid);
if (money > 0 && pmoney >= money)
{
GivePlayerCash(playerid, (0 - money));
GivePlayerCash(id, money);
format(string, sizeof(string), "You've paid %s $%d.", name,id, money);
SendClientMessage(playerid, COLOR_GREEN, string);
format(string, sizeof(string), "You've recieved $%d from %s.", money, sendername, playerid);
SendClientMessage(id, COLOR_GREEN, string);
format(string, sizeof(string), "[D-RP Admin]: %s paid $%d to %s.", sendername, money, name);
if(money >= 70000)
{
ABroadCast(COLOR_RED,string,1);
}
format(string, sizeof(string), "* %s takes out some cash from his pocket and hands it to %s.", sendername , money ,name);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
ApplyAnimation(playerid,"DEALER","shop_pay",4.1,0,0,0,0,0);
}
}
return 1;
}
C:\Users\Bart\Downloads\Script\Central Roleplay Development\C-RP\gamemodes\scratch.pwn(1707) : error 035: argument type mismatch (argument 3)
C:\Users\Bart\Downloads\Script\Central Roleplay Development\C-RP\gamemodes\scratch.pwn(1707) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\Bart\Downloads\Script\Central Roleplay Development\C-RP\gamemodes\scratch.pwn(1707) : error 029: invalid expression, assumed zero
C:\Users\Bart\Downloads\Script\Central Roleplay Development\C-RP\gamemodes\scratch.pwn(1707) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
CMD:pay(playerid, params[])
{
new id, money, sendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], string[128];
if(sscanf(params,"ii", id, money)) return SCM(playerid, COLOR_LIGHTRED,"[D-RP]: {FFFFFF}/pay [playerid/partofname] [ammount]");
if(money < 1 || money > 100000) return SendClientMessage(playerid, COLOR_LIGHTRED,"[D-RP]: {FFFFFF}You can't pay less than $1 or more than $100,000.");
if(ProxDetector(5.0, playerid, id)) return SCM(playerid, COLOR_LIGHTRED,"[D-RP]: {FFFFFF}You are too far away from that player.");
else
{
GetPlayerName(id, name, sizeof(name));
GetPlayerName(playerid, sendername, sizeof(sendername));
new pmoney = GetPlayerMoney(playerid);
if (money > 0 && pmoney >= money)
{
GivePlayerCash(playerid, (0 - money));
GivePlayerCash(id, money);
format(string, sizeof(string), "You've paid %s $%d.", name,id, money);
SendClientMessage(playerid, COLOR_GREEN, string);
format(string, sizeof(string), "You've recieved $%d from %s.", money, sendername, playerid);
SendClientMessage(id, COLOR_GREEN, string);
format(string, sizeof(string), "[D-RP Admin]: %s paid $%d to %s.", sendername, money, name);
if(money >= 70000)
{
ABroadCast(COLOR_RED,string,1);
}
format(string, sizeof(string), "* %s takes out some cash from his pocket and hands it to %s.", sendername , money ,name);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
ApplyAnimation(playerid,"DEALER","shop_pay",4.1,0,0,0,0,0);
}
}
return 1;
}
C:\Users\Bart\Downloads\Script\Central Roleplay Development\C-RP\gamemodes\scratch.pwn(1773) : error 035: argument type mismatch (argument 3) |
if(ProxDetector(5.0, playerid, id)) return SCM(playerid, COLOR_LIGHTRED,"[D-RP]: {FFFFFF}You are too far away from that player."); |
ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
if(IsPlayerConnected(playerid))
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
{
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
{
SendClientMessage(i, col1, string);
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
SendClientMessage(i, col2, string);
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
SendClientMessage(i, col3, string);
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
SendClientMessage(i, col4, string);
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
SendClientMessage(i, col5, string);
}
}
}
}
}
return 1;
}