[Pomoc] /slap

Započeo [GU:RP] ivica 156, Februar 15, 2012, 22:24:21 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim:Cyber
Detaljan opis problema:ma stavio sam ovo da mogu i gs i admini i sada odem na host i nece a na kucnom radilo evo komande:
if(strcmp(cmd, "/slap", true) == 0)
   {
      tmp = strtok(cmdtext, idx);
      if(!strlen(tmp))
      {
         SendClientMessage(playerid, COLOR_ORANGERED, "Koristite: {FFFFFF}/slap [Korisnicki ID ili Ime Korisnika]");
         return 1;
      }
      new playa;
      new Float:shealth;
      new Float:slx, Float:sly, Float:slz;
      if(IsStringAName(tmp))
      {
         playa = GetPlayerID(tmp);
      }
      else
      {
         playa = strval(tmp);
      }
      GetPlayerName(playa, giveplayer, sizeof(giveplayer));
      GetPlayerName(playerid, sendername, sizeof(sendername));
      if (PlayerInfo[playerid][Admin] >= 1 || PlayerInfo[playerid][Admin] >= 1)
      {
         GetPlayerHealth(playa, shealth);
         SetPlayerHealth(playa, shealth-5);
         GetPlayerPos(playa, slx, sly, slz);
         SetPlayerPos(playa, slx, sly, slz+5);
         //PlaySoundAll(playa, 1130, slx, sly, slz+5);
         printf("Admin: %s slapped %s",sendername,  giveplayer);
            format(string, sizeof(string), "|Slap| %s osamaren si, od Admina %s", giveplayer,sendername);
            SendClientMessage(giveplayerid, COLOR_ORANGERED, string);
            format(string, sizeof(string), "|Slap| Igrac %s je osamaren, od Admina %s", giveplayer,sendername);
            PorukaAdminima(COLOR_ORANGERED,string,1);
            GMporuke(COLOR_ORANGERED,string,1);
      }
      else
      {
         SendClientMessage(playerid, COLOR_GRAD1, "{FFFFFF}[{F81414}G-Unit{FFFFFF}]{CCCCCC}Admini samo!");
      }
      return 1;
   }
Dio skripte:
Neke slike/video za lakse dobivanje pomoci(neobavezno):

Ovo zamijeni sa
if(strcmp(cmd, "/slap", true) == 0)
   {
      tmp = strtok(cmdtext, idx);
      if(!strlen(tmp))
      {
         SendClientMessage(playerid, COLOR_ORANGERED, "Koristite: {FFFFFF}/slap [Korisnicki ID ili Ime Korisnika]");
         return 1;
      }
      new playa;
      new Float:shealth;
      new Float:slx, Float:sly, Float:slz;
      if(IsStringAName(tmp))
      {
         playa = GetPlayerID(tmp);
      }
      else
      {
         playa = strval(tmp);
      }
      GetPlayerName(playa, giveplayer, sizeof(giveplayer));
      GetPlayerName(playerid, sendername, sizeof(sendername));
      if (PlayerInfo[playerid][Admin] >= 1 || PlayerInfo[playerid][Admin] >= 1)
      {
         GetPlayerHealth(playa, shealth);
         SetPlayerHealth(playa, shealth-5);
         GetPlayerPos(playa, slx, sly, slz);
         SetPlayerPos(playa, slx, sly, slz+5);
         //PlaySoundAll(playa, 1130, slx, sly, slz+5);
         printf("Admin: %s slapped %s",sendername,  giveplayer);
            format(string, sizeof(string), "|Slap| %s osamaren si, od Admina %s", giveplayer,sendername);
            SendClientMessage(giveplayerid, COLOR_ORANGERED, string);
            format(string, sizeof(string), "|Slap| Igrac %s je osamaren, od Admina %s", giveplayer,sendername);
            PorukaAdminima(COLOR_ORANGERED,string,1);
            GMporuke(COLOR_ORANGERED,string,1);
      }
      else
      {
         SendClientMessage(playerid, COLOR_GRAD1, "{FFFFFF}[{F81414}G-Unit{FFFFFF}]{CCCCCC}Admini samo!");
      }
      return 1;
   }

sa ovime
if(strcmp(cmd, "/slap", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /slap [Player ID]");
return 1;
}
new playa;
new Float:shealth;
new Float:slx, Float:sly, Float:slz;
playa = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pGameMaster] >= 1)
{
    if(IsPlayerConnected(playa))
    {
        if(playa != INVALID_PLAYER_ID)
        {
        GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerHealth(playa, shealth);
SetPlayerHealth(playa, shealth-5);
GetPlayerPos(playa, slx, sly, slz);
SetPlayerPos(playa, slx, sly, slz+5);
PlayerPlaySound(playa, 1130, slx, sly, slz+5);
printf("AdmCmd: %s je odbacio %s u zrak",sendername,  giveplayer);
format(string, sizeof(string), "AdmCmd: %s je odbacen u zrak od strane Admina ili GameMastera %s",giveplayer ,sendername);
BroadCast(COLOR_LIGHTRED,string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "   Nemas prava !!");
}
}
return 1
    }
if(strcmp(cmd, "/punch", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: /slap [playerid/Dio Imena]");
return 1;
}
new playa;
    new Float:slx, Float:sly, Float:slz;
playa = ReturnUser(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1  || IsPlayerAdmin(playerid))
{
    if(IsPlayerConnected(playa))
    {
        if(playa != INVALID_PLAYER_ID)
        {
            new targetlevel = PlayerInfo[playa][pAdmin];
new playerlevel = PlayerInfo[playerid][pAdmin];
if(targetlevel > playerlevel) return SendClientMessage(playerid, COLOR_GREY, "* Nemozes banati ljude veceg ranka od tebe!");
                        if(playa != playerid && Untouchable[playa]) return SendClientMessage(playerid, COLOR_GREY, "* Nemozes to napraviti ovom igracu!");
        GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerPos(playa, slx, sly, slz);
SafeSetPlayerPos(playa, slx, sly, slz+20);
PlayerPlaySound(playa, 1130, slx, sly, slz+20);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s je udario %s.",d,m,y,h,mi,s,sendername,giveplayer);
SlapLog(string);
format(string, sizeof(string), "[ADMIN]: %s je udario %s (%d).",sendername, giveplayer, playa);
ABroadCast(COLOR_LIGHTRED,string, 5);
GameTextForPlayer(playa, "~r~Udaren!",5000,3);
format(string, sizeof(string), "** Uspjesno si udario %s (%d)", giveplayer, playa);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "** Nisi u mogucnosti koristiti ovu komandu!");
}
}
return 1;
}

To prvo zamjeni sa ovim drugim i radice ti!