SA-MP Forums Archive
Need Help In Scripting - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need Help In Scripting (/showthread.php?tid=608845)



Need Help In Scripting - CarRamper - 05.06.2016

Code
Код:
CMD:sit(playerid,params[])
    {
    if(!IsPlayerInRangeOfPoint(playerid, 15.0 , -1517.2539,743.3757,-10.9226  )) return SendClientMessage(playerid,0xFF0000AA,"*You must be in club to use this command.");
    SetPlayerPos(playerid,-1517.2539,743.3757,-10.9226  );
    SetPlayerFacingAngle(playerid, 180.0);
        ApplyAnimation(playerid,"PED","SEAT_IDLE",4,0,0,0, 1,0,1);
        SendClientMessage(playerid, 0xFFFF00C8, "You are now sitting and enjoy.Type  /standup for standing");
        return 1;
 }
And I Want To Make That If A Person Is Sitting On The Chair And Another Player trys To sit on it t says chair already taken Please help Me Fast


Re: Need Help In Scripting - justjamie - 05.06.2016

PHP код:
CMD:sit(playerid,params[])
    {
    if(!
IsPlayerInRangeOfPoint(playerid15.0 , -1517.2539,743.3757,-10.9226  )) return SendClientMessage(playerid,0xFF0000AA,"*You must be in club to use this command.");
        
ApplyAnimation(playerid,"PED","SEAT_IDLE",4,0,0,01,0,1);
        
SendClientMessage(playerid0xFFFF00C8"You are now sitting and enjoy.Type  /standup for standing");
        return 
1;
 } 



Re: Need Help In Scripting - Dayrion - 05.06.2016

PHP код:
new sitting;

CMD:sit(playerid,params[])
{
    if(!
IsPlayerInRangeOfPoint(playerid15.0 , -1517.2539,743.3757,-10.9226  )) return SendClientMessage(playerid,0xFF0000AA,"*You must be in club to use this command.");
    if(
sitting != 0) return SendClientMessage(playerid,0xFF0000AA,"*Someone is already sat here.");
    
SetPlayerPos(playerid,-1517.2539,743.3757,-10.9226  );
    
SetPlayerFacingAngle(playerid180.0);
    
sitting++;
    
ApplyAnimation(playerid,"PED","SEAT_IDLE",4,0,0,01,0,1);
    
SendClientMessage(playerid0xFFFF00C8"You are now sitting and enjoy.Type  /standup for standing");
    return 
1;
}

// In /standup ...
sitting--;