Failure -noobie needs help-
#1

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
Reply
#2

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?
Reply
#3

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?
Reply
#4

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)