[Pomoc] CMD

Započeo [NG | RP] Almir, Decembar 07, 2012, 21:46:07 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta: CLRP
Problem: Ne znam kako da napravim kada kucam /testcmd da mi da 100 grama droge....Evo Vam Admin CMD za postavljanje droge

Dio skripte:
Citatif(strcmp(cmd, "/agivedrugs", true) == 0)
   {
      if (PlayerInfo[playerid][pAdmin] >= 1337)
      {
          if(IsPlayerConnected(playerid))
          {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
               SendClientMessage(playerid, COLOR_GRAD1, "{33FF81}BC {ffffff}| {33F1FF}Pomoc:{ffffff} /agivedrugs [ID Igraca/Dio Imena] [amount]");
               return 1;
            }
            //giveplayerid = strval(tmp);
              giveplayerid = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
               SendClientMessage(playerid, COLOR_GRAD1, "{33FF81}BC {ffffff}| {33F1FF}Pomoc:{ffffff} /agivedrugs [ID Igraca/Dio Imena] [amount]");
               return 1;
            }
            new playa;
            GetPlayerName(playa, sendername, sizeof(sendername));
            playa = ReturnUser(tmp);
            moneys = strval(tmp);
             PlayerInfo[giveplayerid][pDrugs] = moneys;
             GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
            GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, 256, "[ADMIN] %s has given %s %d drugs.", sendername,giveplayer,moneys);
            ABroadCast(COLOR_YELLOW,string,1);
         }
      }
      return 1;
   }
Slike //



if(strcmp(cmd, "/testcmd", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] < 1337) return SCM(playerid, -1, "Niste ovlaasteni");
PlayerInfo[playerid][pDrugs] += 100;


return 1;
}