What's wrong with this CMD?
#1

Код:
CMD:registervehicle(playerid, params[])
{
	new vehicleid;
    foreach(Player, i)
    {
        if(i == playerid)
        {
    		for(new d=0; d<MAX_PLAYERVEHICLES; d++)
	    	{
     			if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
				{
        			if(IsPlayerInRangeOfPoint(playerid, 3.0, CarDealershipInfo[d][cdEntranceX], CarDealershipInfo[d][cdEntranceY], CarDealershipInfo[d][cdEntranceZ]))
					{
		    			if(GetPlayerCash(playerid) >= 500)
		    			{
		    		    	if(PlayerVehicleInfo[i][d][pvId] == vehicleid)
				        	{
				            	if(PlayerVehicleInfo[i][d][pvPlate] == 0)
				        		{
				        	    	new string[128];
				           	 		new randplate = 5000000 + random(999999);//minimum 5000000  max 999999
				            		PlayerVehicleInfo[i][d][pvPlate] = randplate;
				            		format(string, sizeof(string), "You registered this vehicle, vehicle's plate is %d.", randplate);
									SendClientMessageEx(playerid, COLOR_GRAD4, string);
									SendClientMessageEx(playerid, COLOR_GRAD4, "Relog or park your car, to see the vehicle's plate.");
									GivePlayerCash(playerid, -500);
								}
								else
								{
                                	SendClientMessageEx(playerid, COLOR_GRAD4, "This vehicle is already registered.");
								}
							}
							else
							{
						    	SendClientMessageEx(playerid, COLOR_GRAD4, "This is vehicle is not yours.");
							}
						}
						else
						{
						    SendClientMessageEx(playerid, COLOR_GRAD4, "You need $500 to be able to register this vehicle.");
						}
					}
					else
					{
					    SendClientMessageEx(playerid, COLOR_GRAD4, "You're not near any vehicle dealership.");
					}
				}
				else
				{
			    	SendClientMessageEx(playerid, COLOR_GRAD4, "You need to be on the driver's seat to be able to register this vehicle.");
				}
			}
		}
	}
	return 1;
}
Command is not working Even I'm inside my own vehicle, I'm the driver, I got 500, and I'm 3.0 near a Dealership.
+ Elses are spamming their SendClientMessagesEx.

Help!
Reply


Messages In This Thread
What's wrong with this CMD? - by lwilson - 18.04.2015, 13:45
Re: What's wrong with this CMD? - by ball - 18.04.2015, 13:50
Re: What's wrong with this CMD? - by lwilson - 18.04.2015, 13:52
Re: What's wrong with this CMD? - by Jefff - 18.04.2015, 14:18

Forum Jump:


Users browsing this thread: 1 Guest(s)