12.08.2010, 13:01
Hi i have a vehicle spawning system but i want to create a zone where they can spawn those...
How can i make that zone?
How can i make that zone?
//somewhere on the command or whatever:
...
.....
...
if(IsPlayerInArea(coordinates))
{
code
}
else
{
return SendClientMessage(playerid,YOUR_COLOR,"Sorry, but you are not in the vehicle spawning zone.");
}
rest of the code?
return 1;
}
dcmd_car(playerid,params[]) { #pragma unused params IsPlayerInArea(playerid, coordinates); if ( GetPlayerState( playerid ) == PLAYER_STATE_DRIVER ) { #if !defined IGNORE_VEHICLE_ACTIVATION ShowPlayerDefaultDialog( playerid ); return 1; #endif } else { return SendClientMessage(playerid,COLOR_RED,"Sorry, but you are not in the vehicle spawning zone."); } if ( GetPlayerState( playerid ) != PLAYER_STATE_PASSENGER ) ShowPlayerDefaultDialog( playerid ); // and i get warning here : warning 225: unreachable code return 1; }
dcmd_car(playerid,params[]) { #pragma unused params if ( GetPlayerState( playerid ) == PLAYER_STATE_DRIVER ) { #if !defined IGNORE_VEHICLE_ACTIVATION { ShowPlayerDefaultDialog( playerid ); return 1; #endif } } if ( GetPlayerState( playerid ) != PLAYER_STATE_PASSENGER ) ShowPlayerDefaultDialog( playerid ); return 1; }
dcmd_car(playerid,params[]) { #pragma unused params if ( GetPlayerState( playerid ) == PLAYER_STATE_DRIVER ) { #if !defined IGNORE_VEHICLE_ACTIVATION { for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerInArea(i, -543.5457, 2640.1458, -504.1658, 2546.2039)) ShowPlayerDefaultDialog( playerid ); else { return SendClientMessage(playerid,COLOR_RED,"Sorry, but you are not in the vehicle spawning zone."); } return 1; #endif } } if ( GetPlayerState( playerid ) != PLAYER_STATE_PASSENGER ) ShowPlayerDefaultDialog( playerid ); return 1; }