function heading differs from prototype
#1

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

OnPlayerRequestSpawn does not have the classid.

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

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

The classid is on
pawn Код:
OnPlayerRequestClass
Reply
#5

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

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;
}
Reply
#7

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;
Reply
#8

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

example?
Reply
#10

A beautiful way to make this, is using y_classes:

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


Forum Jump:


Users browsing this thread: 2 Guest(s)