pawno errors
#1

hi,

im trying to make my own filtre script but i keep getting errors and i dont understand why can someone help.

errors
PHP код:
C:\Users\tom\Desktop\pay gateopen.pwn(9) : warning 202number of arguments does not match definition
C
:\Users\tom\Desktop\pay gateopen.pwn(10) : error 029invalid expressionassumed zero
C
:\Users\tom\Desktop\pay gateopen.pwn(10) : warning 215expression has no effect
C
:\Users\tom\Desktop\pay gateopen.pwn(10) : error 001expected token";"but found ")"
C:\Users\tom\Desktop\pay gateopen.pwn(10) : error 029invalid expressionassumed zero
C
:\Users\tom\Desktop\pay gateopen.pwn(10) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
4 Errors

PHP код:
#include <a_samp>
#define COLOR_RED 0xAA3333AA
public OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/pay"cmdtexttrue10) == 0)
    {
        if(
IsPlayerInRangeOfPoint(playerid,1110.4412,-1738.2471,13.4317))return SendClientMessage(playerid,COLOR_RED,"You are too far from the gate to pay");
        if(
GetPlayerMoney(playerid, < 500))return SendClientMessage(playerid,COLOR_RED,"You do not have enough money");
        if(
GetPlayerMoney(playerid, > 500))return SendClientMessage(playerid,COLOR_RED,"You have just paid and the gate is open");
        {
        
MoveObject(9801101.7249755859, -1741.276733398415.273958206177,2.0)
        }
        return 
1;
     }
     return 
0;

Reply
#2

Try this. You forgot too add a range parameter on IsPlayerInRangeOfPoint.

pawn Код:
#include <a_samp>

#define COLOR_RED 0xAA3333AA

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (!strcmp("/pay", cmdtext, true))
    {
        if(IsPlayerInRangeOfPoint(playerid,50.0/*range*/,1110.4412,-1738.2471,13.4317))
            return SendClientMessage(playerid,COLOR_RED,"You are too far from the gate to pay");
        if(GetPlayerMoney(playerid, < 500))
            return SendClientMessage(playerid,COLOR_RED,"You do not have enough money");
        if(GetPlayerMoney(playerid, > 500))
            return SendClientMessage(playerid,COLOR_RED,"You have just paid and the gate is open");

        MoveObject(980, 1101.7249755859, -1741.2767333984, 15.273958206177,2.0)
        return 1;
     }
     return 0;
}
Reply
#3

http://pastebin.com/GHTx8DNX

Thanks to pater.
Reply
#4

C:\Users\tom\Desktop\pay gateopen.pwn(11) : warning 217: loose indentation
C:\Users\tom\Desktop\pay gateopen.pwn(11) : warning 202: number of arguments does not match definition
C:\Users\tom\Desktop\pay gateopen.pwn(13) : warning 217: loose indentation
C:\Users\tom\Desktop\pay gateopen.pwn(14) : error 017: undefined symbol "SetPlayerMoney"
C:\Users\tom\Desktop\pay gateopen.pwn(16) : warning 217: loose indentation
C:\Users\tom\Desktop\pay gateopen.pwn(1 : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

i dont know wot to do i only know basic scripting
Reply
#5

'SetPlayerMoney' is not an existing function , use GivePlayerMoney(playerid, amount <-- the amount you want to give);
Reply
#6

no i want it to take money away from them
Reply
#7

pawn Код:
//first you got a function wrong its
//IsPlayerInRangeOfPoint(playerid,Range,X,Y,Z);

//and  this should fix it
if (strcmp(cmdtext, "/pay", true) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid,90,1110.4412,-1738.2471,13.4317)) return SendClientMessage(playerid,red,"You are too far from the gate to pay");
        if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid,red,"You do not have enough money");
        if(GetPlayerMoney(playerid) > 500)
        {
         SendClientMessage(playerid,red,"You have just paid and the gate is open");
         MoveObject(980, 1101.7249755859, -1741.2767333984, 15.273958206177,2.0);
         GivePlayerMoney(playerid,-500);
        }
        return 1;
     }
Reply
#8

thanx guys for all of ur help all iv got to do know is try to get the gate to open, then i will upload it to forum thanx xx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)