Pomoc oko scriptanja

Započeo Chris, Jul 27, 2009, 22:06:20 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 5 gostiju pregledaju ovu temu.

KAko da napravim komandu /lideri

molim vas objasnite mi treba mi hitno

matejdz

Od onoga koliko si se hvalio da si PROOO SKRIPTER neznas to napraviti :S

Evo ti za pocetak:

if (strcmp(cmd, "/lideri", true) == 0)
{
        if(IsPlayerConnected(playerid))
    {
SendClientMessage(playerid, COLOR_GRAD1, "Leaderi Online:");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
    if(PlayerInfo[i][pLeader] == 1)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "PD: %s", sendername);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
                else if(PlayerInfo[i][pLeader] == 2)
    {
GetPlayerName(i, sendername, sizeof(sendername));
format(string, 256, "FBI: %s", sendername);
SendClientMessage(playerid, COLOR_GRAD2, string);
}

Ja ti napravim, sam reci koje trebas organizacije,ili si ih sam promjeni,evo ti tu dolje:D

                  if (strcmp(cmd, "/lideri", true) == 0)
   {
       if(IsPlayerConnected(playerid))
       {
         SendClientMessage(playerid, COLOR_GRAD1, "Lideri Online:");
         for(new i = 0; i < MAX_PLAYERS; i++)
         {
            if(IsPlayerConnected(i))
            {
                if(PlayerInfo[pLeader] == 1)
                {
                  GetPlayerName(i, sendername, sizeof(sendername));
                  format(string, 256, "PD lider: %s", sendername);
                  SendClientMessage(playerid, COLOR_GRAD2, string);
               }
                else if(PlayerInfo[pLeader] == 2)
                {
                  GetPlayerName(i, sendername, sizeof(sendername));
                  format(string, 256, "FBI lider: %s", sendername);
                  SendClientMessage(playerid, COLOR_GRAD2, string);
               }
               else if(PlayerInfo[pLeader] == 3)
                {
                  GetPlayerName(i, sendername, sizeof(sendername));
                  format(string, 256, "CIA lider: %s", sendername);
                  SendClientMessage(playerid, COLOR_GRAD2, string);
               }
                else if(PlayerInfo[pLeader] == 4)
                {
                  GetPlayerName(i, sendername, sizeof(sendername));
                  format(string, 256, "MD lider: %s", sendername);
                  SendClientMessage(playerid, COLOR_GRAD2, string);
               }
               else if(PlayerInfo[pLeader] == 5)
                {
                  GetPlayerName(i, sendername, sizeof(sendername));
                  format(string, 256, "La Cosa Nostra lider: %s", sendername);
                  SendClientMessage(playerid, COLOR_GRAD2, string);
               }
               else if(PlayerInfo[pLeader] == 6)
                {
                  GetPlayerName(i, sendername, sizeof(sendername));
                  format(string, 256, "Triads lider: %s", sendername);
                  SendClientMessage(playerid, COLOR_GRAD2, string);
               }
               else if(PlayerInfo[pLeader] == 8)
                {
                  GetPlayerName(i, sendername, sizeof(sendername));
                  format(string, 256, "Hitman lider: %s", sendername);
                  SendClientMessage(playerid, COLOR_GRAD2, string);
               }
               else if(PlayerInfo[pLeader] == 9)
                {
                  GetPlayerName(i, sendername, sizeof(sendername));
                  format(string, 256, "WildWest News lider: %s", sendername);
                  SendClientMessage(playerid, COLOR_GRAD2, string);
               }
               else if(PlayerInfo[pLeader] == 10)
                {
                  GetPlayerName(i, sendername, sizeof(sendername));
                  format(string, 256, "Taxi lider: %s", sendername);
                  SendClientMessage(playerid, COLOR_GRAD2, string);
               }
               else if(PlayerInfo[pLeader] == 11)
                {
                  GetPlayerName(i, sendername, sizeof(sendername));
                  format(string, 256, "Licenseri lider: %s", sendername);
                  SendClientMessage(playerid, COLOR_GRAD2, string);
               }
            }
         }
      }


samo promjeni organizacije, ili ostavi iste ako imas iste :D

I bolje si promjenis, ove su ti bzvz:D



         
Poslednja Izmena: Avgust 19, 2009, 17:01:26 POSLE PODNE od [LG]Stormer[LG]

Chrome

Evo ti brze i efikasne komande:

#if !defined MAX_ORG_NAME
#define MAX_ORG_NAME (32)
#endif

#if !defined MAX_INT_LEN
#define MAX_INT_LEN (11)
#endif

#if !defined MAX_LOSHOW_LEN
#define MAX_LOSHOW_LEN (MAX_ORG_NAME+MAX_INT_LEN+7)
#endif

#if !defined SCMPlayer(%1)
#define SCP(%1) SendClientMessage(playerid, COLOR_YELLOW, %1)
#endif

#if !defined SCM
        #define SCM SendClientMessage
#endif

dcmd_lideri(playerid, params[])
{
#pragma unused params
if(!IsPlayerConnected(playerid)) return 0;
SCM(playerid, COLOR_YELLOW, "-- Lideri online --");
SCM(playerid, COLOR_YELLOW, " ");
for(new i;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i)) continue;
else if(!PlayerInfo[i][Leader]) continue;
else
{
new
playerNameBuffer[MAX_PLAYER_NAME],
localArray[MAX_LOSHOW_LEN];

GetPlayerName(i, playerNameBuffer, MAX_PLAYER_NAME);
switch(PlayerInfo[i][Leader])
{
case 1:
{
format(localArray, sizeof localArray, "PD Lider: %s", playerNameBuffer);
SCP(localArray);
}
case 2:
{
format(localArray, sizeof localArray, "FBI Lider: %s", playerNameBuffer);
SCP(localArray);
}
// ...
}
}
}
return 1;
}


Eto trebalo bi radit  :D
I sad ovako povecavas case-ove do kolko oces; i naravno samo moras promijeniti "PD Lider" u "Blablabla Lider" i tako do kraja  ;)
Have fun  ;)

@Stormer

Ne treba mu toliko slova; dosta mu je MAX_ORG_NAME(default sam stavio 32) + maksimalana duzina cijelog broja(11) + 7 znakova(razmaci, dvotocka i "Lider")...

@matejDZ

Bezveze ides na 10+ checkova ako nije lider; bolje se prije rijesit jeli je ili nije pa onda na checkove  ;)
pazi to ti je = 10* recimo 190(10 su lidera) igraca = 1900 bespotrebnih checkova a kod mene ih ima 190  :)

matejdz

Citat@matejDZ

Bezveze ides na 10+ checkova ako nije lider; bolje se prije rijesit jeli je ili nije pa onda na checkove  Wink
pazi to ti je = 10* recimo 190(10 su lidera) igraca = 1900 bespotrebnih checkova a kod mene ih ima 190  Smiley

Mislis da on zna ubaciti ovo tvoje....