Pay at gates
#1

hy how make in this script with pay function at gates?

Quote:

forward Gates1Check();
public Gates1Check()
{
new gates1_status;
for(new i;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i)) continue;
if(IsPlayerInRangeOfPoint(i,10.0, 1780.80004883, 701.40002441, 15.80000019))gates1_status=1;
}
if(gates1_status)MoveObject(gates1, 1780.69995117, 701.40002441, 12.80000019, 0.5);
else MoveObject(gates1, 1780.80004883, 701.40002441, 15.80000019, 6.5);
return;
}

Reply
#2

when the gates open use:
pawn Код:
GivePlayerMoney(playerid, -50);
now the money of the player will get reduced with $50 so he pays $50 for the gates.

place it at the place in your code where you want it
Reply
#3

pawn Код:
forward Gates1Check();
public Gates1Check()
{
new gates1_status;
for(new i;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i)) continue;
if(IsPlayerInRangeOfPoint(i,10.0, 1780.80004883, 701.40002441, 15.80000019))gates1_status=1;
}
if(gates1_status)
MoveObject(gates1, 1780.69995117, 701.40002441, 12.80000019, 0.5);
GivePlayerMoney(playerid,-1000);// 1000 Money on gate opening.....
else MoveObject(gates1, 1780.80004883, 701.40002441, 15.80000019, 6.5);
return;
}
Reply
#4

shows undifined simbol "playerid"

Quote:
Originally Posted by niels44
Посмотреть сообщение
when the gates open use:
pawn Код:
GivePlayerMoney(playerid, -50);
now the money of the player will get reduced with $50 so he pays $50 for the gates.

place it at the place in your code where you want it
and second tipe show

D:\trucking\filterscripts\toll1.pwn(40) : error 017: undefined symbol "playerid"
D:\trucking\filterscripts\toll1.pwn(41) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#5

Quote:
Originally Posted by livests
Посмотреть сообщение
shows undifined simbol "playerid"



and second tipe show

D:\trucking\filterscripts\toll1.pwn(40) : error 017: undefined symbol "playerid"
D:\trucking\filterscripts\toll1.pwn(41) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.
You Have to Change You Funtion to Player Function... Like...

pawn Код:
forward Gates1Check(playerid);
public Gates1Check(playerid)
{
new gates1_status;
for(new i;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i)) continue;
if(IsPlayerInRangeOfPoint(i,10.0, 1780.80004883, 701.40002441, 15.80000019))gates1_status=1;
}
if(gates1_status)
MoveObject(gates1, 1780.69995117, 701.40002441, 12.80000019, 0.5);
GivePlayerMoney(playerid,-1000);// 1000 Money on gate opening.....
else MoveObject(gates1, 1780.80004883, 701.40002441, 15.80000019, 6.5);
return;
}
Now Use:
pawn Код:
Gates1Check(playerid);
In place of "Gates1Check();" in your command.
Reply
#6

ok it will show like this i guess
and need anounce tekst u pay toll how to get it?
Quote:

forward Gates1Check(playerid);
public Gates1Check(playerid)
{
new gates1_status;
for(new i;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i)) continue;
if(IsPlayerInRangeOfPoint(i,10.0, 1780.80004883, 701.40002441, 15.80000019))gates1_status=1;
GivePlayerMoney(playerid,-20);
}
if(gates1_status)MoveObject(gates1, 1780.69995117, 701.40002441, 12.80000019, 0.5);
else MoveObject(gates1, 1780.80004883, 701.40002441, 15.80000019, 6.5);
return;
}

Reply
#7

Quote:
Originally Posted by livests
Посмотреть сообщение
still shows D:\trucking\filterscripts\toll1.pwn(41) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
and how to get show like anounce u pay toll **$
Please Post Command in Which you are using this Function...


pawn Код:
SendClientMessage(playerid,0xFFFAAA,"You Have paid for toll.");
Use this for sending message to playerid.
Reply
#8

i to like u say but then im near gates they open and dont need to pay and if i put ther u say then show invalid expresion assumed zero

Quote:
Originally Posted by Shabi RoxX
Посмотреть сообщение
You Have to Change You Funtion to Player Function... Like...

pawn Код:
forward Gates1Check(playerid);
public Gates1Check(playerid)
{
new gates1_status;
for(new i;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i)) continue;
if(IsPlayerInRangeOfPoint(i,10.0, 1780.80004883, 701.40002441, 15.80000019))gates1_status=1;
}
if(gates1_status)
MoveObject(gates1, 1780.69995117, 701.40002441, 12.80000019, 0.5);
GivePlayerMoney(playerid,-1000);// 1000 Money on gate opening.....
else MoveObject(gates1, 1780.80004883, 701.40002441, 15.80000019, 6.5);
return;
}
Now Use:
pawn Код:
Gates1Check(playerid);
In place of "Gates1Check();" in your command.
Reply
#9

Post cOMMAND cODES
Reply
#10

#include <a_samp>
//#if defined FILTERSCRIPT
new gates1;
new gates2;
new gates3;
new gates4;
new gates5;
new gates6;

public OnFilterScriptInit()
{
SetTimer("Gates1Check", 500, true);
SetTimer("Gates2Check", 500, true);
SetTimer("Gates3Check", 500, true);
SetTimer("Gates4Check", 500, true);
SetTimer("Gates5Check", 500, true);
SetTimer("Gates6Check", 500, true);

gates1 = CreateObject(8674, 1780.80004883, 701.40002441, 15.80000019, 0.00000000, 0.00000000, 352.00000000);
gates2 = CreateObject(8674, 1795.40002441, 713.09997559, 14.89999962, 0.00000000, 0.00000000, 354.00000000);
gates3 = CreateObject(971, -2667.80004883, 1277.90002441, 56.29999924, 0.00000000, 0.00000000, 0.00000000);
gates4 = CreateObject(971, -2677.30004883, 1277.59997559, 56.29999924, 0.00000000, 0.00000000, 0.00000000);
gates5 = CreateObject(971, -2686.19995117, 1271.50000000, 56.29999924, 0.00000000, 0.00000000, 178.00000000);
gates6 = CreateObject(971, -2695.39990234, 1270.59997559, 56.20000076, 0.00000000, 0.00000000, 178.00000000);

//gate = CreateObject(Model id, x, y, z, rx, ry, rz); = How to set up the gate. Use the closed position
return 1;
}

forward Gates1Check(playerid);
public Gates1Check(playerid)
{
new gates1_status;
for(new i;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i)) continue;
if(IsPlayerInRangeOfPoint(i,10.0, 1780.80004883, 701.40002441, 15.80000019))gates1_status=1;
}
if(gates1_status)MoveObject(gates1, 1780.69995117, 701.40002441, 12.80000019, 0.5);
GivePlayerMoney(playerid,-20);
SendClientMessage(playerid,0xFFFAAA,"You Have paid for toll.");
else MoveObject(gates1, 1780.80004883, 701.40002441, 15.80000019, 6.5);
return;
}


D:\trucking\filterscripts\toll1.pwn(42) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)