SA-MP Forums Archive
26 errors... - 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: 26 errors... (/showthread.php?tid=328584)



26 errors... - Gooday - 25.03.2012

pawn Код:
forward OnPlayerStateChange(playerid,newstate,oldstate);
public OnPlayerStateChange(playerid,newstate,oldstate){
{
    if  (newstate==PLAYER_STATE_DRIVER)
        {
            SendClientMessage(playerid,COLOR_GREY,"You entered a vehicle, drive safely!");
            SendClientMessage(playerid,COLOR_GREY,"Type /engine & /lights to switch them on and off.");
        }
    }
    return 1;
    if(newstate == PLAYER_STATE_ONFOOT)
    {
        if(GetPVarInt(playerid,"Lights")>0)
        {
            SetPVarInt(playerid,"Lights",0);
            if(IsValidObject(GetPVarInt(playerid,"Siren1")))
            {
                DestroyObject(GetPVarInt(playerid,"Siren1"));
            }
            if(IsValidObject(GetPVarInt(playerid,"Siren2")))
            {
                DestroyObject(GetPVarInt(playerid,"Siren2"));
            }
        }
    }
    return 1;
}
This gives me 26 errors


Re: 26 errors... - Twisted_Insane - 25.03.2012

pawn Код:
if  (newstate==PLAYER_STATE_DRIVER)
{
            SendClientMessage(playerid,COLOR_GREY,"You entered a vehicle, drive safely!");
            SendClientMessage(playerid,COLOR_GREY,"Type /engine & /lights to switch them on and off.");
}
return 1;
//rest here



AW: 26 errors... - Campbell- - 25.03.2012

pawn Код:
forward OnPlayerStateChange(playerid,newstate,oldstate);
public OnPlayerStateChange(playerid,newstate,oldstate){
{
    if  (newstate==PLAYER_STATE_DRIVER)
    {
         SendClientMessage(playerid,COLOR_GREY,"You entered a vehicle, drive safely!");
         SendClientMessage(playerid,COLOR_GREY,"Type /engine & /lights to switch them on and off.");
    }
    return 1;
    if(newstate == PLAYER_STATE_ONFOOT)
    {
        if(GetPVarInt(playerid,"Lights")>0)
        {
            SetPVarInt(playerid,"Lights",0);
            if(IsValidObject(GetPVarInt(playerid,"Siren1")))
            {
                DestroyObject(GetPVarInt(playerid,"Siren1"));
            }
            if(IsValidObject(GetPVarInt(playerid,"Siren2")))
            {
                DestroyObject(GetPVarInt(playerid,"Siren2"));
            }
        }
    }
    return 1;
}
You used a '}' too much in the first lines.

EDIT: Someone was faster, heh.


Re: 26 errors... - Twisted_Insane - 25.03.2012

Was it necessary to re-post what I just did?


Re: 26 errors... - Kaczmi - 25.03.2012

pawn Код:
public OnPlayerStateChange(playerid,newstate,oldstate){
{
    if  (newstate==PLAYER_STATE_DRIVER)
    {
         SendClientMessage(playerid,COLOR_GREY,"You entered a vehicle, drive safely!");
         SendClientMessage(playerid,COLOR_GREY,"Type /engine & /lights to switch them on and off.");
    }
    if(newstate == PLAYER_STATE_ONFOOT)
    {
        if(GetPVarInt(playerid,"Lights")>0)
        {
            SetPVarInt(playerid,"Lights",0);
            if(IsValidObject(GetPVarInt(playerid,"Siren1")))
            {
                DestroyObject(GetPVarInt(playerid,"Siren1"));
            }
            if(IsValidObject(GetPVarInt(playerid,"Siren2")))
            {
                DestroyObject(GetPVarInt(playerid,"Siren2"));
            }
        }
    }
    return 1;
}



Re: 26 errors... - Twisted_Insane - 25.03.2012

Dude, stop re-posting what already two others did, okay? You just wanna get some un-deserved reputation points while stealing solutions from other people!!


Respuesta: Re: 26 errors... - kirk - 25.03.2012

Quote:
Originally Posted by Twisted_Insane
Посмотреть сообщение
Was it necessary to re-post what I just did?
You posted it at the same time, aswell yours lacks of an explanation an understanding.

Quote:
Originally Posted by Twisted_Insane
Посмотреть сообщение
Dude, stop re-posting what already two others did, okay? You just wanna get some un-deserved reputation points while stealing solutions from other people!!
reputation doesnt grow your dick.