SA-MP Forums Archive
Need scripting 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: Need scripting help (/showthread.php?tid=389612)



Need scripting help - 69 - 02.11.2012

Hello there. I come again for some scripting help. Please send in some helpful responses and I might +rep you!

I would like the following:
- I would like to know how to restrict skins to players with 20+ score.
- I would like to know how to make races (with multiple starting points, you drive to one and /startrace)

I will bump this topic if I need more help, thanks a lot and I hope I get a response quick.


Re: Need scripting help - x96664 - 02.11.2012

Quote:
Originally Posted by 69
Посмотреть сообщение
- I would like to know how to restrict skins to players with 20+ score.
If I udnerstood you right you need this:
pawn Код:
if(GetPlayerSkin(playerid) == 0)
    {
        if(GetPlayerScore(playerid) < 20)
        {
            SendClientMessage(playerid,-1,"You need to have 20 score to play with this skin!");
            return 0;
        }
    }
It's not tested!
Edit: It should be added on
Код:
OnPlayerRequestSpawn
And you didn't tell is it of certain skins or its for all of them ?


Re : Re: Need scripting help - 69 - 02.11.2012

Quote:
Originally Posted by x96664
Посмотреть сообщение
If I udnerstood you right you need this:
pawn Код:
if(GetPlayerSkin(playerid) == 0)
    {
        if(GetPlayerScore(playerid) < 20)
        {
            SendClientMessage(playerid,-1,"You need to have 20 score to play with this skin!");
            return 0;
        }
    }
It's not tested!
Edit: It should be added on
Код:
OnPlayerRequestSpawn
And you didn't tell is it of certain skins or its for all of them ?
This function only sends a message, it doesn't prevent the player from choosing the skin

EDIT: Didn't read your edited message, it works!!


Re: Re : Re: Need scripting help - x96664 - 02.11.2012

Quote:
Originally Posted by 69
Посмотреть сообщение
This function only sends a message, it doesn't prevent the player from choosing the skin
Код:
return 0;
should stop him!


Re : Need scripting help - 69 - 02.11.2012

It works. Anyways, how about the racing thing, please


Re : Need scripting help - 69 - 02.11.2012

Sorry for the double post but I'd also like to know how to restrict ONE vehicle (preferably by its ID) to a certain score.
Also how to restrict a vehicle to a certain name (you can't enter if your name is not SixtyNine for example).