SA-MP Forums Archive
What the fu*k is wrong with that shit?! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: What the fu*k is wrong with that shit?! (/showthread.php?tid=212920)



What the fu*k is wrong with that shit?! - sekol - 18.01.2011

I go really pissed off by that one simple command!
PHP код:
''1st error''COMMAND:makemeadmin{playerid, params[])
{
    
''2nd error''if(IsPlayerAdmin(playerid))
    {
        
PlayerInfo[playerid][pAdminLevel] = 6;
    
SendClientMessage(playerid, COLOR_WHITE, "You are now level 6 admin!");
    }
    
''3rd error''else SendClientaMessage(playerid, COLOR_WHITE, "You can't do this!");
} 
Код:
C:\DOCUME~1\Machlik\MOJEDO~1\POBIER~1\SAMP03~1\GAMEMO~1\IRPG2.pwn(184) : error 010: invalid function or declaration
C:\DOCUME~1\Machlik\MOJEDO~1\POBIER~1\SAMP03~1\GAMEMO~1\IRPG2.pwn(186) : error 010: invalid function or declaration
C:\DOCUME~1\Machlik\MOJEDO~1\POBIER~1\SAMP03~1\GAMEMO~1\IRPG2.pwn(191) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
WHAT"S WRONG WITH IT! It does'nt look too complicated! I'm sure my zcmd works fine cause my other LONGER and MUCH MORE COMPLICATED commands work fine!
Example:
PHP код:
COMMAND:afrakcja(playerid, params[])
{
    new 
cmd[128], string[128], otherstring[128], idfrakcji;
    if(
IsPlayerAdmin(playerid))
    {
        if(
sscanf(params, "s", cmd) != 0)
        {
               return 
SendClientMessage(playerid, COLOR_WHITE, "[O-RP "VERSION"] UŻYJ: /afrakcja <nazwa | komendy | rangi | skiny | spawn>");
        }
         if(
strcmp("nazwa", cmd, true, 5) == 0)
        {
            new 
nazwa[128];
            if(!
sscanf(params, "sds", cmd, idfrakcji, nazwa))
            {
                if(
idfrakcji >= 1 && idfrakcji <=20)
                {
                    new 
zdanie[128];
                    
format(otherstring, sizeof(otherstring),"Faction_%d/FactionName",idfrakcji); format(string, sizeof(string), "%s", nazwa);    djSet(FACTIONS_FILE,otherstring,string,true);
                    
djCommit(FACTIONS_FILE);
                    
format(zdanie, sizeof(zdanie), "[O-RP "VERSION"] Zmieniłeś nazwę frakcji [%d] na %s", idfrakcji, string);
                    
SendClientMessage(playerid, COLOR_WHITE, zdanie);
                }
                else return 
SendClientMessage(playerid, COLOR_WHITE, "[O-RP "VERSION"] ID frakcji nie może być niższe od 1 i wyższe od 20!");
            }
            else return 
SendClientMessage(playerid, COLOR_WHITE, "[O-RP "VERSION"] UŻYJ: /afrakcja nazwa <id> <nazwa>");
        }
          if(
strcmp("komendy", cmd, true, 7) == 0)
          {
              new 
typkomend;
              if(!
sscanf(params, "sdd", cmd, idfrakcji, typkomend))
              {
                  new 
zdanie[128];
                  
format(otherstring, sizeof(otherstring),"Faction_%d/CommandsType",idfrakcji);   djSetInt(FACTIONS_FILE,otherstring,typkomend,true);
                
djCommit(FACTIONS_FILE);
                
format(zdanie, sizeof(zdanie), "[O-RP "VERSION"] Zmieniłeś typ komend frakcji [%d] na [%d]", idfrakcji, typkomend);
                
SendClientMessage(playerid, COLOR_WHITE, zdanie);
            }
            else return 
SendClientMessage(playerid, COLOR_WHITE, "[O-RP "VERSION"] UŻYJ: /afrakcja komendy <id> <typ komend>");
        }
        if(
strcmp("rangi", cmd, true, 5) == 0)
          {
              new 
ranga, nazwarangi[128];
              if(!
sscanf(params, "sdds", cmd, idfrakcji, ranga, nazwarangi))
              {
                  new 
zdanie[128];
                  
format(otherstring, sizeof(otherstring),"Faction_%d/Rank%d",idfrakcji, ranga); format(string, sizeof(string), "%s", nazwarangi);   djSet(FACTIONS_FILE,otherstring,string,true);
                
djCommit(FACTIONS_FILE);
                
format(zdanie, sizeof(zdanie), "[O-RP "VERSION"] Zmieniłeś nazwe rangi %d, frakcji [%d] na %s", ranga, idfrakcji, string);
                
SendClientMessage(playerid, COLOR_WHITE, zdanie);
            }
            else return 
SendClientMessage(playerid, COLOR_WHITE, "[O-RP "VERSION"] UŻYJ: /afrakcja rangi <id> <id rangi> <nazwa rangi>");
        }
        if(
strcmp("skiny", cmd, true, 5) == 0)
          {
              new 
idslotu, idskinu;
              if(!
sscanf(params, "sddd", cmd, idfrakcji, idslotu, idskinu))
              {
                  new 
zdanie[128];
                  
format(otherstring, sizeof(otherstring),"Faction_%d/Skin%d",idfrakcji, idslotu);    djSetInt(FACTIONS_FILE,otherstring,idskinu,true);
                
djCommit(FACTIONS_FILE);
                
format(zdanie, sizeof(zdanie), "[O-RP "VERSION"] Zmieniłeś ID skinu nr.%d na %d, dla frakcji [%d]", idslotu, idskinu, idfrakcji);
                
SendClientMessage(playerid, COLOR_WHITE, zdanie);
            }
            else return 
SendClientMessage(playerid, COLOR_WHITE, "[O-RP "VERSION"] UŻYJ: /afrakcja skiny <id> <id slotu> <idskinu>");
        }
        if(
strcmp("spawn", cmd, true, 5) == 0)
          {
              if(!
sscanf(params, "sd", cmd, idfrakcji))
              {
                  new 
zdanie[128], Float:x, Float:y, Float:z;
                  
GetPlayerPos(playerid, x, y, z);
                  
format(otherstring, sizeof(otherstring),"Faction_%d/X",idfrakcji);    djSetFloat(FACTIONS_FILE,otherstring,x,true);
                  
format(otherstring, sizeof(otherstring),"Faction_%d/Y",idfrakcji);    djSetFloat(FACTIONS_FILE,otherstring,y,true);
                  
format(otherstring, sizeof(otherstring),"Faction_%d/Z",idfrakcji);    djSetFloat(FACTIONS_FILE,otherstring,z,true);
                  
format(otherstring, sizeof(otherstring),"Faction_%d/Interior",idfrakcji);    djSetInt(FACTIONS_FILE,otherstring,GetPlayerInterior(playerid),true);
                
djCommit(FACTIONS_FILE);
                
format(zdanie, sizeof(zdanie), "[O-RP "VERSION"] Ustawiłeś spawn frakcji [%d] na %f %f %f oraz %d interior.", idfrakcji, x, y, z, GetPlayerInterior(playerid));
                
SendClientMessage(playerid, COLOR_WHITE, zdanie);
            }
            else return 
SendClientMessage(playerid, COLOR_WHITE, "[O-RP "VERSION"] UŻYJ: /afrakcja spawn <id>");
        }
    }
    return 
1;
} 
THIS ONE COMPILES WITHOUT ANY F*CKING ERROR!


Re: What the fu*k is wrong with that shit?! - Karlip - 18.01.2011

What's the errors from the first one?


Re: What the fu*k is wrong with that shit?! - sekol - 18.01.2011

Forgot them Edited now.


Re: What the fu*k is wrong with that shit?! - Grim_ - 18.01.2011

You're using the wrong brace (should be parenthesis). Also forgot a return.
pawn Код:
COMMAND:makemeadmin(playerid, params[])
{
    if(IsPlayerAdmin(playerid))
    {
        PlayerInfo[playerid][pAdminLevel] = 6;
        SendClientMessage(playerid, COLOR_WHITE, "You are now level 6 admin!");
    }
    else SendClientaMessage(playerid, COLOR_WHITE, "You can't do this!");
    return 1;
}



Re: What the fu*k is wrong with that shit?! - sekol - 18.01.2011

Thanks. I was ready to throw my comp outta window -.-