Having a problem with /bike command
#1

Hey together again,

I have a small problem with my /bike command. It isn't working. So I write this command nothing comes out, nothing in chat, nothing in the console. Look over:

Код:
CMD:bike(playerid, params[])
{
	if(pData[playerid][pLevel] < 4 && pData[playerid][pMoney] > GetPlayerMoney(playerid)){
	if(IsPlayerInRangeOfPoint(playerid, 15, 1315.7648,-1382.5044,13.7960)){
			new Float:x, Float:y, Float:z;
	        GetPlayerPos(playerid, Float:x, Float:y, Float:z);
			CreateVehicle(481, x,y,z, 0, -1, -1, 90000);
			SendClientMessage(playerid, COLOR_GOLD, "You have sucessfully rent a bike");
			printf("[SERVER]: Bike (ID: 481) created at Spawn");
			GivePlayerMoney(playerid, -400);
		}else{
			SendClientMessage(playerid, COLOR_RED, "You're not near the Bike Rentshop at the Spawn");
		}
	}

	if(pData[playerid][pLevel] > 4 && pData[playerid][pMoney] < GetPlayerMoney(playerid)){
	SendClientMessage(playerid, COLOR_RED, "You're higher than level 4 or has less then $400 in your pocket.");
	}
	return 1;
}
CONSOLE
Код:
[join] HAGAKURE has joined the server (0:127.0.0.1)
[SERVER] HAGAKURE (ID: 0): /bike
[SERVER] HAGAKURE (ID: 0): /bike
[SERVER] HAGAKURE (ID: 0): /bike
[SERVER] HAGAKURE (ID: 0): /bike
[SERVER] HAGAKURE (ID: 0): /bike
[SERVER] HAGAKURE (ID: 0): /bike
[SERVER] HAGAKURE (ID: 0): /bike
I don't understand, why nothing comes out. Some minutes ago it worked perfectly.
Reply
#2

The way you have the two statements is really bad and also comparing server-side money to money returned by GetPlayerMoney instead of checking about the amount ($400).

What about the player's level being 4? Your statements check about lower or greater than that.
Reply
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
The way you have the two statements is really bad and also comparing server-side money to money returned by GetPlayerMoney instead of checking about the amount ($400).

What about the player's level being 4? Your statements check about lower or greater than that.
Seems like my MySQL System is little bit buggy. Gonna rewrite it. But still thanks for trying to help me.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)