06.10.2010, 14:03
how do i make a command that when you do /pay on the checkpoint and it will take away like 2000 cash and the gate will open please help
if(!strcmp("/pay",cmdtext))
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, YourX, YourY, YourZ)) //7.0 is the range
{
GivePlayerMoney(playerid, -2000);
SendClientMessage(playerid,0xFFFFFFFF,"Gate opening!");
//MoveObject...
}
return 1;
}
GivePlayerMoney(playerid, -2000);
if(!strcmp("/pay",cmdtext))
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, YourX, YourY, YourZ)) //7.0 is the range
{
if(GetPlayerMoney(playerid)>2000)
{
GivePlayerMoney(playerid, -2000);
SendClientMessage(playerid,0xFFFFFFFF,"Gate opening!");
//MoveObject...
return 1;
}
else return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You need 2000$ to open the gate!");
}
else return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You need to be near the gate to open it!");
}