Some errors
#1

PHP код:
CMD:pay(playeridparams[])
{
    new 
idmoneysendername[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME], string[128];
    if(
sscanf(params,"ii"idmoney)) return SCM(playeridCOLOR_LIGHTRED,"[D-RP]: {FFFFFF}/pay [playerid/partofname] [ammount]");
    if(
money || money 100000) return SendClientMessage(playeridCOLOR_LIGHTRED,"[D-RP]: {FFFFFF}You can't pay less than $1 or more than $100,000.");
    if(
ProxDetector(5.0playeridid)) return SCM(playeridCOLOR_LIGHTRED,"[D-RP]: {FFFFFF}You are too far away from that player".);
    else
    {
         
GetPlayerName(idnamesizeof(name));
        
GetPlayerName(playeridsendernamesizeof(sendername));
        new 
pmoney GetPlayerMoney(playerid);
        if (
money && pmoney >= money)
        {
            
GivePlayerCash(playerid, (money));
            
GivePlayerCash(idmoney);
            
format(stringsizeof(string), "You've paid %s $%d."name,idmoney);
            
SendClientMessage(playeridCOLOR_GREENstring);
            
format(stringsizeof(string), "You've recieved $%d from %s."moneysendernameplayerid);
            
SendClientMessage(idCOLOR_GREENstring);
            
format(stringsizeof(string), "[D-RP Admin]: %s paid $%d to %s."sendernamemoneyname);
            if(
money >= 70000)
            {
                
ABroadCast(COLOR_RED,string,1);
            }
            
format(stringsizeof(string), "* %s takes out some cash from his pocket and hands it to %s."sendername money ,name);
            
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            
ApplyAnimation(playerid,"DEALER","shop_pay",4.1,0,0,0,0,0);
        }
    }
    return 
1;

The Errors:


PHP код:
C:\Users\Bart\Downloads\Script\Central Roleplay Development\C-RP\gamemodes\scratch.pwn(1707) : error 035argument type mismatch (argument 3)
C:\Users\Bart\Downloads\Script\Central Roleplay Development\C-RP\gamemodes\scratch.pwn(1707) : error 001expected token"-string end-"but found "-identifier-"
C:\Users\Bart\Downloads\Script\Central Roleplay Development\C-RP\gamemodes\scratch.pwn(1707) : error 029invalid expressionassumed zero
C
:\Users\Bart\Downloads\Script\Central Roleplay Development\C-RP\gamemodes\scratch.pwn(1707) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
4 Errors

Reply
#2

pawn Код:
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;
}
What was the fix?... misplaced dot.
Reply
#3

Quote:

C:\Users\Bart\Downloads\Script\Central Roleplay Development\C-RP\gamemodes\scratch.pwn(1773) : error 035: argument type mismatch (argument 3)

LINE 1773 is :
Quote:

if(ProxDetector(5.0, playerid, id)) return SCM(playerid, COLOR_LIGHTRED,"[D-RP]: {FFFFFF}You are too far away from that player.");

Reply
#4

Argument type mismatch error usually appears when the argument that you pass is different from the argument that the function expects.Mind showing your "ProxDetector" function?
Reply
#5

PHP код:
ProxDetector(Float:radiplayeridstring[],col1,col2,col3,col4,col5)
{
    if(
IsPlayerConnected(playerid))
    {
        new 
Float:posxFloat:posyFloat:posz;
        new 
Float:oldposxFloat:oldposyFloat:oldposz;
        new 
Float:tempposxFloat:tempposyFloat:tempposz;
        
GetPlayerPos(playeridoldposxoldposyoldposz);
        for(new 
0MAX_PLAYERSi++)
        {
            if(
IsPlayerConnected(i))
            {
                
GetPlayerPos(iposxposyposz);
                
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(icol1string);
                    }
                    else if (((
tempposx radi/8) && (tempposx > -radi/8)) && ((tempposy radi/8) && (tempposy > -radi/8)) && ((tempposz radi/8) && (tempposz > -radi/8)))
                    {
                        
SendClientMessage(icol2string);
                    }
                    else if (((
tempposx radi/4) && (tempposx > -radi/4)) && ((tempposy radi/4) && (tempposy > -radi/4)) && ((tempposz radi/4) && (tempposz > -radi/4)))
                    {
                        
SendClientMessage(icol3string);
                    }
                    else if (((
tempposx radi/2) && (tempposx > -radi/2)) && ((tempposy radi/2) && (tempposy > -radi/2)) && ((tempposz radi/2) && (tempposz > -radi/2)))
                    {
                        
SendClientMessage(icol4string);
                    }
                    else if (((
tempposx radi) && (tempposx > -radi)) && ((tempposy radi) && (tempposy > -radi)) && ((tempposz radi) && (tempposz > -radi)))
                    {
                        
SendClientMessage(icol5string);
                    }
                }
            }
        }
    }
    return 
1;

Reply
#6

Well, ProxDetector parameters are "Float:radi, playerid, string[],col1,col2,col3,col4,col5", and check out your parameters: "5.0, playerid, id".
Reply
#7

Oh i got it, thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)