14.02.2015, 17:41
The Problem is that how i can save the Playerid who want to duel with the other guy... because i want to use his ID also the Cash amount ..in /accept cmd
Код:
CMD:duel(playerid, params[]) { new ID,weap,cost; if(sscanf(params, "uii",ID,weap, cost)) return SCM(playerid, 0xFFFF00AA, "/duel ID [weapon ID] [cash]"); if(Duel[playerid]==1)return SCM(playerid, 0xFFFF00AA, "You already in duel.)"); if(!IsPlayerConnected(ID)) return SCM(playerid, 0xFFFF00AA, "Player is not connected.))"); if(ID == playerid) return SCM(playerid, 0xFFFF00AA, "Invalid ID."); if(GetPlayerMoney(playerid) < cost)return SCM(playerid, 0xFFFF00AA, "You dont have that much cash."); else { weapNam[playerid]=weap; Amount[playerid]=cost; format(Message, 128, "%s has invite you to duel with him with weapon : %s and with winning Amount %d", GetName(playerid),weapNam[playerid],Amount[playerid]); SCM(ID, 0xFFFF00AA, Message); Invite[ID]=1; DuelID[playerid]=playerid; // I'm trying to saving playerid here... } return 1; } CMD:accept(playerid, params[]) { if(Duel[playerid]==1)return SCM(playerid, 0xFFFF00AA, "You already in duel.))"); if(Invite[playerid]!=1)return SCM(playerid, 0xFFFF00AA, "You're not invited on any duel.))"); if(GetPlayerMoney(playerid) < Amount[playerid])return SCM(playerid, 0xFFFF00AA, "You dont have that much cash."); else if (strcmp(params,"1",true) == 0) { ResetPlayerWeapons(playerid); ResetPlayerWeapons(DuelID[playerid]); format(Message,sizeof(Message),"The duel between %s(%i) and %s(%i) has started",GetName(DuelID[playerid]),DuelID[playerid],GetName(DuelID[playerid]),playerid); SCMToAll(COLOR_YELLOW,Message); SetPlayerInterior(playerid,10);SetPlayerInterior(DuelID[playerid],10); SetPlayerPos(playerid,-973.190856,1060.630981,1345.674316);SetPlayerPos(DuelID[playerid],-1132.407104,1057.550781,1346.410034); SetPlayerFacingAngle(playerid,88.169311);SetPlayerFacingAngle(DuelID[playerid],268.964355); GivePlayerWeapon(playerid,weapNam[playerid],2000); GivePlayerWeapon(DuelID[playerid],weapNam[playerid],2000); Invite[playerid]=0; Duel[playerid]=1; Duel[DuelID[playerid]]=1; } else if (strcmp(params,"0",true) == 0) { Duel[playerid]=0; Duel[DuelID[playerid]]=0; Invite[playerid]=0; SCM(DuelID[playerid], -1, "Your Oponent refuse to duel with you."); } return 1; }