[HELP]How to make /enter /exit with zcmd
#1

Here's my IsPlayerInRangeOfPoint: IsPlayerInRangeOfPoint(playerid, 4.0, 2522.8105,-1679.3905,15.4970)) in i want to spawn in sweets house.
Reply
#2

PHP код:
CMD:enter(playeridparams[]) 
{
    if(
IsPlayerInRangeOfPoint(playerid4.02522.8105,-1679.3905,15.4970))
    {
        
SetPlayerPos (playeridxyz);
        
SetPlayerInterior (playeridinterior);
    }
    else 
SendClientMessage (playerid, -1"You must stay near a door");
    return 
1;
}
CMD:exit(playeridparams[]) 
{
    if(
IsPlayerInRangeOfPoint(playerid4.0xyz))
    {
        
SetPlayerPos (playerid2522.8105, -1679.390515.4970);
        
SetPlayerInterior (playerid0);
    }
    else 
SendClientMessage (playerid, -1"You must stay near a door");
    return 
1;

Reply
#3

PHP код:
CMD:enter(playerid,params[])
{
    
// First line: We are checking if here IS NOT near the entrance and if we confirm that we return him message.
    
if(!IsPlayerInRangeOfPoint(playerid,4.0,2522.8105,-1679.3905,15.4970)) return SendClientMessage(playerid,-1,"ERROR: You are not near the entrance");
    else 
// else if he is near the entrance...
    
{
        
SetPlayerPos(playerid,2527.654052,-1679.388305,1015.498596); // Setting position..
        
SetPlayerInterior(playerid,1); // ... And interior. DONE!
    
}
    return 
1;
}
CMD:exit(playerid,params[])
{
    
// Here we have done the same thing just changed the coordinates.
    
if(!IsPlayerInRangeOfPoint(playerid,4.0,2527.654052,-1679.388305,1015.498596)) return SendClientMessage(playerid,-1,"ERROR: You are not near the exit");
    else
    {
        
SetPlayerPos(playerid,2522.8105,-1679.3905,15.4970);
        
SetPlayerInterior(playerid,0);
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)