SA-MP Forums Archive
Failure -noobie needs help- - 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)
+--- Thread: Failure -noobie needs help- (/showthread.php?tid=554485)



Failure -noobie needs help- - SpasticCaveman - 03.01.2015

Here's my code

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/Jihad", cmdtext, true, 10) == 0)
{
	new vehicleid
    PutPlayerInVehicle(playerid, vehicleid, 0);
    return 1;
    SetTimer("Jihad", 60000, false);
    SendClientMessage("In 60 seconds your vehicle will explode! (If you want to abort do /StopJihad")
    }
	SetVehicleHealth(vehicleid, 0)
	SendClientMessage("You have successfully Jihaded!")
	}
}
public OnPlayerCommandText(playerid, cmdtext[]){

	if (strcmp("/StopJihad", cmdtext, true, 10) == 0)
{
	new vehicleid;
	vehicleid= GetPlayerVehicleID(playerid);
	DestroyVehicle(vehicleid);
          return 1;
     }

     return 0;
	 SendClientMessage("You're not preforming a Jihad!);
	}
}

Here's the errors
Код:
C:\Users\Thevenomousgamer\Desktop\COD7ver3.0\filterscripts\Jihad1.pwn(94) : error 001: expected token: ";", but found "-identifier-"
C:\Users\Thevenomousgamer\Desktop\COD7ver3.0\filterscripts\Jihad1.pwn(96) : warning 225: unreachable code
C:\Users\Thevenomousgamer\Desktop\COD7ver3.0\filterscripts\Jihad1.pwn(97) : error 035: argument type mismatch (argument 1)
C:\Users\Thevenomousgamer\Desktop\COD7ver3.0\filterscripts\Jihad1.pwn(99) : error 017: undefined symbol "vehicleid"
C:\Users\Thevenomousgamer\Desktop\COD7ver3.0\filterscripts\Jihad1.pwn(100) : error 035: argument type mismatch (argument 1)
C:\Users\Thevenomousgamer\Desktop\COD7ver3.0\filterscripts\Jihad1.pwn(103) : error 021: symbol already defined: "OnPlayerCommandText"
C:\Users\Thevenomousgamer\Desktop\COD7ver3.0\filterscripts\Jihad1.pwn(110) : warning 217: loose indentation
C:\Users\Thevenomousgamer\Desktop\COD7ver3.0\filterscripts\Jihad1.pwn(113) : warning 217: loose indentation
C:\Users\Thevenomousgamer\Desktop\COD7ver3.0\filterscripts\Jihad1.pwn(114) : warning 225: unreachable code
C:\Users\Thevenomousgamer\Desktop\COD7ver3.0\filterscripts\Jihad1.pwn(114) : error 037: invalid string (possibly non-terminated string)
C:\Users\Thevenomousgamer\Desktop\COD7ver3.0\filterscripts\Jihad1.pwn(114) : error 017: undefined symbol "You"
C:\Users\Thevenomousgamer\Desktop\COD7ver3.0\filterscripts\Jihad1.pwn(114) : warning 215: expression has no effect
C:\Users\Thevenomousgamer\Desktop\COD7ver3.0\filterscripts\Jihad1.pwn(114) : error 001: expected token: ";", but found "-identifier-"
C:\Users\Thevenomousgamer\Desktop\COD7ver3.0\filterscripts\Jihad1.pwn(114) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase



Re: Failure -noobie needs help- - Sledgehammer - 03.01.2015

pawn Код:
new vehicleid;

SendClientMessage("In 60 seconds your vehicle will explode! (If you want to abort do /StopJihad");
Thats the only error I see - What are the other lines that are causing errors?


Re: Failure -noobie needs help- - SpasticCaveman - 03.01.2015

Quote:
Originally Posted by Death1300
Посмотреть сообщение
pawn Код:
new vehicleid;

SendClientMessage("In 60 seconds your vehicle will explode! (If you want to abort do /StopJihad");
Thats the only error I see - What are the other lines that are causing errors?
How do I fix that? What is the problem so I can avoid this next time?


Re: Failure -noobie needs help- - Sledgehammer - 03.01.2015

Second - Fixing up your code. I've seen more errors.


Re: Failure -noobie needs help- - Sledgehammer - 03.01.2015

pawn Код:
forward JiHad(playerid);
public JiHad(playerid)
{
     SetVehicleHealth(vehicleid, 0)
     SendClientMessage("You have successfully Jihaded!")
     return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/Jihad", cmdtext, true, 10) == 0)
        {
        new vehicleid;
            if(!sscanf(cmdtext, "d", vehicleid) return SendClientMessage(playerid, -1, "/Jihad<vehicleid>");
            PutPlayerInVehicle(playerid, vehicleid, 0);
            SetTimerEx("Jihad", 60000, false, "d", playerid);
            SendClientMessage("In 60 seconds your vehicle will explode! (If you want to abort do /StopJihad");
            return 1;
        }
        if (strcmp("/StopJihad", cmdtext, true, 10) == 0)
        {
         new vehicleid = GetPlayerVehicleID(playerid);
         DestroyVehicle(vehicleid);
             return 1;
        }
        return 1;
}
There where quite a few errors in your code.