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; }
[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
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. |