Coding a gate [Errors/+rep] -
Jack.7331 - 14.03.2012
So I've been trying to code a gate for a gang in my server, all the info is in the pastebin.
http://pastebin.com/tuy1qBjR
+rep for anyone who helps.
Re: Coding a gate [Errors/+rep] -
Daddy Yankee - 14.03.2012
pawn Код:
CMD:rbmgateopen(playerid, params[]) {
if(playerVariables[playerid][pGroup] == 4)
{
if (IsPlayerInRangeOfPoint(playerid, 5, 1013.40002441,-1542.09997559,16.10000038) && GetPlayerInterior(playerid) == 0)
{
MoveObject(RBMGate, 1013.40002441,-1542.09997559,16.10000038, 5);
return 1;
}
}
}
Hope it helps
Re: Coding a gate [Errors/+rep] -
Jack.7331 - 14.03.2012
Quote:
Originally Posted by Daddy Yankee
pawn Код:
CMD:rbmgateopen(playerid, params[]) { if(playerVariables[playerid][pGroup] == 4) { if (IsPlayerInRangeOfPoint(playerid, 5, 1013.40002441,-1542.09997559,16.10000038) && GetPlayerInterior(playerid) == 0) { MoveObject(RBMGate, 1013.40002441,-1542.09997559,16.10000038, 5); return 1; } } }
Hope it helps
|
Thanks so much, although I do get
C:\Users\Jack\Desktop\Server\vx-rp.pwn(5591) : warning 209: function "cmd_rbmgateopen" should return a value, line 5591 is
pawn Код:
CMD:rbmgateopen(playerid, params[]) {
if(playerVariables[playerid][pGroup] == 4)
{
if (IsPlayerInRangeOfPoint(playerid, 5, 1013.40002441,-1542.09997559,16.10000038) && GetPlayerInterior(playerid) == 0)
{
MoveObject(RBMGate, 1013.40002441,-1542.09997559,16.10000038, 5);
return 1;
}
}
} //Error line
Re: Coding a gate [Errors/+rep] -
Daddy Yankee - 14.03.2012
Try putting another return 1; before that line
Re: Coding a gate [Errors/+rep] -
ReneG - 14.03.2012
Daddy Yankee, please post code that works.
This works.
pawn Код:
CMD:rbmgateopen(playerid, params[])
{
if(playerVariables[playerid][pGroup] == 4)
{
if (IsPlayerInRangeOfPoint(playerid, 5, 1013.40002441,-1542.09997559,16.10000038) && GetPlayerInterior(playerid) == 0)
{
MoveObject(RBMGate, 1013.40002441,-1542.09997559,16.10000038, 5);
return 1;
}
}
return 1;
} //Error
Re: Coding a gate [Errors/+rep] -
Jack.7331 - 14.03.2012
Sorry, but I'm a total n00b, where do I place it? Just before the very end #endif?
Re: Coding a gate [Errors/+rep] -
Daddy Yankee - 14.03.2012
Take the code from Vincent, it's exactly what I've said
Re: Coding a gate [Errors/+rep] -
Jack.7331 - 14.03.2012
Help?