[pomoc]Moze ovo netko pretvoriti u zcmd?

Započeo antonio600x, Oktobar 13, 2011, 08:59:40 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: Tu stavis ime skripte
Detaljan opis problema:

Moze minetko to pretvoriti u zcmd??ja pokuso ali uvijek imam error,gledo na sampu i opet nis.

i da jel ima koji tut za kuce kako napraviti za modove od 0

Dio skripte:
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);

   if (streq(cmd,"/setleader1"))
{
   if(!strlen(cmdtext[12]))
   {
       SendClientMessage(playerid, red, "Usage: /setleader1 [playerid]");
       return 1;
   }
   new ID = strval(cmdtext[12]);
   new pName[24], str[64];
   if(IsPlayerConnected(ID))
   {
       GetPlayerName(playerid, pName, 24);
       format(str, 123, "Admin %s has set your the leader of organization Rudyy's Gang.", pName);
       SendClientMessage(ID,COLOR_LIGHTBLUE, str);
       SetPlayerColor(ID, 0x00C300FF); // Color
       GivePlayerWeapon(ID,28,5000); // Weapon1
       GivePlayerWeapon(ID,1,-1); // Weapon 2
       IsInOrg[ID] = 1; // This tells that the user is already in an organization.
       Member[ID] = 1; //This is org id, forexample my org id i want is 1 , so i will put 1, if i want it 2 , i will put 2. Note; do not duplicate the number.
       Leader[ID] = 1; //This will remain as "1". This shows that the player ur setting is a leader.
       IsLaw[ID] = 0; // This shows that the org is not a law enforcement, its a Gang.
       format(str, 123, "You have set a player leader of Rudyy's Gang.");
       SendClientMessage(playerid,red, str);
   }
   return 1;

}
if(Leader[playerid] == 1) {
if (streq(cmd,"/setmember"))
{
   if(!strlen(cmdtext[11]))
   {
       SendClientMessage(playerid, red, "Usage: /setmember [playerid]");
       return 1;
   }
   new ID = strval(cmdtext[11]);
   new pName[24], str[64];
   if(IsPlayerConnected(ID))
   {
       GetPlayerName(playerid, pName, 24);
    if(IsInOrg[ID] == 1) return SendClientMessage(playerid,red,"Ths user is already in an organization!");
    else   if(Member[playerid] == 1 && Member[ID] == 0)
{
       format(str, 123, "Your application to join Rudy's Gang has been accepted by leader %s.", pName);
SendClientMessage(ID,COLOR_LIGHTBLUE,str);
      SetPlayerColor(ID,0x0000BBAA); //color
       SendClientMessage(ID,green, str);
       GivePlayerWeapon(ID,24,250); //weapon1
       GivePlayerWeapon(ID,3,99999); //weapon2
       GivePlayerWeapon(ID,29,1000); //weapon3 (optional)
       IsInOrg[ID] = 1; //Shows that the user that leader is recruiting is is in org.
       IsLaw[ID] = 0; //Not a law, gang.
       Member[ID] = 1; // Org ID
       format(str, 123, "You have accepted the following member into your organization.");
       SendClientMessage(playerid,COLOR_LIGHTBLUE, str);
}
return 1;
}
}
}

    else if (streq(cmd,"/kickmember"))
{
   if(!strlen(cmdtext[11]))
   {
       SendClientMessage(playerid, red, "Usage: /kickmember [playerid]");
       return 1;
   }

   new ID = strval(cmdtext[11]);
   new pName[24], str[64];

   if(IsPlayerConnected(ID))
   {
       GetPlayerName(playerid, pName, 24);
if(Member[playerid] == 1 && Member[ID] == 1)
{
       format(str, 123, "Leader %s has kicked you from organization Rudy's gang.", pName);
       SendClientMessage(ID,COLOR_ORANGE, str);
       SetPlayerSkin(ID, 299);
       ResetPlayerWeapons(ID);
       Member[ID] = 0;
       IsLaw[playerid] = 0;
       IsInOrg[ID] = 0;
       SetPlayerColor(ID, 0xFFFFFFFF);
       format(str, 123, "You have kicked a player from Rudy's gang.");
       SendClientMessage(playerid,red, str);

}
return 1;
}
}

Neke slike/video za lakse dobivanje pomoci(neobavezno): /


Moderator: Sada sam ti ja edit post jer si nov na ovom forumu kolko vidim pa necu da lock temu.
Ubuduce otvaraj u ovom pdf temu po ovim pravilima:
http://balkan-samp.com/forum/index.php?topic=11453.0
Poslednja Izmena: Oktobar 13, 2011, 09:22:01 PRE PODNE od [BD]Gagi

dragan12

   CMD:setleader1(playerid,params[])
{
   if(!strlen(cmdtext[12]))
   {
       SendClientMessage(playerid, red, "Usage: /setleader1 [playerid]");
       return 1;
   }
   new ID = strval(cmdtext[12]);
   new pName[24], str[64];
   if(IsPlayerConnected(ID))
   {
       GetPlayerName(playerid, pName, 24);
       format(str, 123, "Admin %s has set your the leader of organization Rudyy's Gang.", pName);
       SendClientMessage(ID,COLOR_LIGHTBLUE, str);
       SetPlayerColor(ID, 0x00C300FF); // Color
       GivePlayerWeapon(ID,28,5000); // Weapon1
       GivePlayerWeapon(ID,1,-1); // Weapon 2
       IsInOrg[ID] = 1; // This tells that the user is already in an organization.
       Member[ID] = 1; //This is org id, forexample my org id i want is 1 , so i will put 1, if i want it 2 , i will put 2. Note; do not duplicate the number.
       Leader[ID] = 1; //This will remain as "1". This shows that the player ur setting is a leader.
       IsLaw[ID] = 0; // This shows that the org is not a law enforcement, its a Gang.
       format(str, 123, "You have set a player leader of Rudyy's Gang.");
       SendClientMessage(playerid,red, str);
   }
   return 1;

}
if(Leader[playerid] == 1) {
CMD:setmember(playerid,params[])
{
   if(!strlen(cmdtext[11]))
   {
       SendClientMessage(playerid, red, "Usage: /setmember [playerid]");
       return 1;
   }
   new ID = strval(cmdtext[11]);
   new pName[24], str[64];
   if(IsPlayerConnected(ID))
   {
       GetPlayerName(playerid, pName, 24);
    if(IsInOrg[ID] == 1) return SendClientMessage(playerid,red,"Ths user is already in an organization!");
    else   if(Member[playerid] == 1 && Member[ID] == 0)
{
       format(str, 123, "Your application to join Rudy's Gang has been accepted by leader %s.", pName);
SendClientMessage(ID,COLOR_LIGHTBLUE,str);
      SetPlayerColor(ID,0x0000BBAA); //color
       SendClientMessage(ID,green, str);
       GivePlayerWeapon(ID,24,250); //weapon1
       GivePlayerWeapon(ID,3,99999); //weapon2
       GivePlayerWeapon(ID,29,1000); //weapon3 (optional)
       IsInOrg[ID] = 1; //Shows that the user that leader is recruiting is is in org.
       IsLaw[ID] = 0; //Not a law, gang.
       Member[ID] = 1; // Org ID
       format(str, 123, "You have accepted the following member into your organization.");
       SendClientMessage(playerid,COLOR_LIGHTBLUE, str);
}
return 1;
}
}
}

    CMD:kickmember(playerid,params[])
{
   if(!strlen(cmdtext[11]))
   {
       SendClientMessage(playerid, red, "Usage: /kickmember [playerid]");
       return 1;
   }

   new ID = strval(cmdtext[11]);
   new pName[24], str[64];

   if(IsPlayerConnected(ID))
   {
       GetPlayerName(playerid, pName, 24);
if(Member[playerid] == 1 && Member[ID] == 1)
{
       format(str, 123, "Leader %s has kicked you from organization Rudy's gang.", pName);
       SendClientMessage(ID,COLOR_ORANGE, str);
       SetPlayerSkin(ID, 299);
       ResetPlayerWeapons(ID);
       Member[ID] = 0;
       IsLaw[playerid] = 0;
       IsInOrg[ID] = 0;
       SetPlayerColor(ID, 0xFFFFFFFF);
       format(str, 123, "You have kicked a player from Rudy's gang.");
       SendClientMessage(playerid,red, str);

}
return 1;
}
}

Eto ali bolje je zcmd + sscanf

EDIT:
Pa ako hoces od 0 ima tut samo postupak kako uraditi ali ako nisi neki u skriptanju onda bolje nemoj.
Poslednja Izmena: Oktobar 13, 2011, 09:22:36 PRE PODNE od [BD]Gagi

Imam error
C:\Documents and Settings\Administrator\Desktop\SAMP-server\gamemodes\gmbeta.pwn(666) : error 017: undefined symbol "cmdtext"
C:\Documents and Settings\Administrator\Desktop\SAMP-server\gamemodes\gmbeta.pwn(666) : warning 215: expression has no effect
C:\Documents and Settings\Administrator\Desktop\SAMP-server\gamemodes\gmbeta.pwn(666) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Administrator\Desktop\SAMP-server\gamemodes\gmbeta.pwn(666) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrator\Desktop\SAMP-server\gamemodes\gmbeta.pwn(666) : fatal error 107: too many error messages on one line

666=if(!strlen(cmdtext[12]))
Poslednja Izmena: Oktobar 13, 2011, 10:43:11 PRE PODNE od antonio600x

vlado_plavsic

Stavi tu komandu na kraj skripte,jer zcmd komande ne idu u ni jedan callback...

Nop, ovo sto je gagi stavio nikako ne valja.
Mucni mozgom i videces dosta greski.