SA-MP Forums Archive
Need help! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need help! (/showthread.php?tid=264219)



Need help! - Pasa - 25.06.2011

Because i am new i need help on 1 litle pawn code:
if (strcmp("/parking", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0,1378.5527,-1878.5848,13.3010))
if(IsPlayerInAnyVehicle(playerid))
MoveObject(rampa,1378.8427734375, -1882.046875, 8.424617767334,10);
SendClientMessage(playerid, 0xFFFFFFAA, "Platili ste parking,sada parkirajte svoje vozilo!");
GivePlayerMoney(playerid,-10);
}
if (strcmp("/pizlaz", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,5.0,1370.8451,-1883.7241,13.5184))
if(IsPlayerInAnyVehicle(playerid))
MoveObject(rampa2,1370.236328125, -1880.978515625, 8.2246170043945,10);
SendClientMessage(playerid, 0xFFFFFFAA, "Hvala sto ste koristili nase usluge parkiranja!");
}
when i use the comand /parking in any place than i see the message and it takes me 10 $ how can i fix it
that only send the message and take the money on the IsPlayerInRangeOfPoint

sorry for bad english!


Re: Need help! - Lorenc_ - 25.06.2011

Delete the code:
pawn Код:
GivePlayerMoney(playerid,-10);
From that line...


Re: Need help! - Pasa - 25.06.2011

this is a parking sistem and to park player need to pay 10$ and the gate will open,but i dont know how to make that player pay only on the IsPlayerInRangeOfPoint!


Re: Need help! - Cameltoe - 25.06.2011

Quote:
Originally Posted by Pasa
Посмотреть сообщение
this is a parking sistem and to park player need to pay 10$ and the gate will open,but i dont know how to make that player pay only on the IsPlayerInRangeOfPoint!
change to :

pawn Код:
if(!IsPlayerInRangeOfPoint(playerid, 5.0,1378.5527,-1878.5848,13.3010)) return SendClientMessage(playerid, 0x0, "You have to be at the gate to use this command");



Re: Need help! - Wesley221 - 25.06.2011

pawn Код:
if (strcmp("/parking", cmdtext, true, 10) == 0)
{
    if(IsPlayerInRangeOfPoint(playerid, 5.0,1378.5527,-1878.5848,13.3010))
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            MoveObject(rampa,1378.8427734375, -1882.046875, 8.424617767334,10);
            SendClientMessage(playerid, 0xFFFFFFAA, "Platili ste parking,sada parkirajte svoje vozilo!");
            GivePlayerMoney(playerid,-10);
        }
    } else return SendClientMessage(playerid, 0xFFFFFFAA, "Your weird language text in here if hes not in range");
    return 1;
}

if (strcmp("/pizlaz", cmdtext, true, 10) == 0)
{
    if(IsPlayerInRangeOfPoint(playerid,5.0,1370.8451,-1883.7241,13.5184))
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            MoveObject(rampa2,1370.236328125, -1880.978515625, 8.2246170043945,10);
            SendClientMessage(playerid, 0xFFFFFFAA, "Hvala sto ste koristili nase usluge parkiranja!");
        }
    } else return SendClientMessage(playerid, 0xFFFFFFAA, "Same if hes not in range");
    return 1;
}
You forgot to open the functions, always open a function before putting something in it


Re: Need help! - Pasa - 25.06.2011

thanks man!


Re: Need help! - Pasa - 25.06.2011

The parking script will be realesed today!

sry for bad english


Re: Need help! - Cameltoe - 25.06.2011

Quote:
Originally Posted by Pasa
Посмотреть сообщение
The parking script will be realesed today!

sry for bad english
Do not release anything you barely know how to script yourself.

Try once again, tweak, recreate, add functions. It's easy once you first get it.

Also, double posting is a nono on this forum.