SA-MP Forums Archive
function heading differs from prototype - 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: function heading differs from prototype (/showthread.php?tid=308381)



function heading differs from prototype - Vrondakis - 03.01.2012

So I have this script:
pawn Код:
public OnPlayerRequestClass(playerid,classid)
{
    if(classid == vrondakisclass)  // if class id is vrondakisclass
    {
        if(!PlayerNameIs(playerid, "Vrondakis"))  // and player's name is not Vrondakis
        {
            SendClientMessage(playerid,COLOR_RED,"You are not the mighty Vrondakis");  // will send a message
            return 0;  // and will not let them spawn
        }
    }
    return 1;
}
Is there anyway to have it on public OnPlayerRequestSpawn instead of public OnPlayerRequestClass?
Because currently, when your looking through the characters, When you go past ID1 it says "You are not the mighty vrondakis" and puts you back to the previous skin.

I want it to do the exactly same thing but only when you press the spawn button.

Here's what I tried:

pawn Код:
public OnPlayerRequestSpawn(playerid,classid)
{
    if(classid == vrondakisclass)  // if class id is vrondakis class
    {
        if(!PlayerNameIs(playerid, "Vrondakis"))  // and player's name is not Vrondakis
        {
            SendClientMessage(playerid,COLOR_RED,"You are not the mighty Vrondakis");  // will send a message
            return 0;  // and will not let them spawn
        }
    }
    return 1;
}
But I get error:
Код:
error 025: function heading differs from prototype



Re: function heading differs from prototype - Vince - 03.01.2012

OnPlayerRequestSpawn does not have the classid.

This forum requires that you wait 120 seconds between posts. Please try again in 70 seconds. -,-


Re: function heading differs from prototype - Vrondakis - 03.01.2012

I know that. But is there anyway to make something similar to it?


Re: function heading differs from prototype - Konstantinos - 03.01.2012

The classid is on
pawn Код:
OnPlayerRequestClass



Re: function heading differs from prototype - Vrondakis - 03.01.2012

Quote:
Originally Posted by Dwane
Посмотреть сообщение
The classid is on
pawn Код:
OnPlayerRequestClass
No shit?


Re: function heading differs from prototype - Konstantinos - 03.01.2012

Quote:
Originally Posted by Vrondakis
Посмотреть сообщение
No shit?
What do you mean by that?
Also, on the Callback you used, I think it's possible to make it with
pawn Код:
public OnPlayerSpawn(playerid)
{
    new skin = GetPlayerSkin(playerid);
    if(skin == 186))  // if skin is 186 for example
    {
        if(!PlayerNameIs(playerid, "Vrondakis"))  // and player's name is not Vrondakis
        {
            SendClientMessage(playerid,COLOR_RED,"You are not the mighty Vrondakis");  // will send a message
            return 0;  // and will not let them spawn
        }
    }
    return 1;
}



Re: function heading differs from prototype - Vrondakis - 03.01.2012

Quote:
Originally Posted by Dwane
Посмотреть сообщение
What do you mean by that?
I know! That's why its not working, which is why I posted this.
I need somthing that will work similar to it. When the player clicks spawn on a skin, it says "You are not the mighty Vrondakis" and returns 0;


AW: function heading differs from prototype - BigETI - 03.01.2012

There is no classid in OnPlayerRequestSpawn.
If you need the classid from OnPlayerRequestClass, so use variables.


Re: function heading differs from prototype - Vrondakis - 03.01.2012

example?


Re: function heading differs from prototype - CyNiC - 03.01.2012

A beautiful way to make this, is using y_classes:

https://sampforum.blast.hk/showthread.php?tid=244271