SA-MP Forums Archive
How to do this? - 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: How to do this? (/showthread.php?tid=662928)



How to do this? - akib - 16.01.2019

How to make a cmd like,

/biz till, name, lock

if strcmp pass then syntax will be /set pass [new pass]

i tried this but result is zero
PHP код:
CMD:biz(playerid,params[]){
    new 
cmd[20],playername[MAX_PLAYER_NAME],newbizname[20];
    
GetPlayerName(playeridplayernamesizeof(playername));
    for(new 
i=1;i<sizeof(BizInfo);i++){
        if(
IsPlayerInRangeOfPoint(playerid2BizInfo[i][ib_x], BizInfo[i][ib_y], BizInfo[i][ib_z])){
            if(
GetPlayerVirtualWorld(playerid)==BizInfo[i][b_id]){
                if(!
strcmp(BizInfo[i][b_owner], playername)){
                    if(
sscanf(params"s[20]"cmd)) return SendClientMessage(playeridCOLOR_ORANGE"Usage:{FFFFFF} /biz till, lock, name");
                    if(!
strcmp(cmd"name")){
                        if(
sscanf(params"s[20]s[20]"cmd,newbizname)) return SendClientMessage(playeridCOLOR_ORANGE"Usage:{FFFFFF} /biz name [New BIZ Name]");
                        
printf("%s"newbizname); // didn't rcvd
                        
print("Biz name updated"); // Didn't rcvd
                    
}
                }else{
                    return 
SendClientMessage(playeridCOLOR_ORANGE"You aren't owner of this business.");
                }
            }
        }
    }
    return 
1;