Glasses
#1

so a friend gave glasses sistem but how can i make it so i do /buyglasses in clothstore and if i buy a pair of glasses i can do /glasses all the time untill i buy another pair..even if i restart i do /glasses and i put on/off glasses..

PHP код:
if(!strcmp("/ochelari",cmd,true))
                    {
                        
tmp strtok(cmdtextidx);
                        
skin GetPlayerSkin(playerid);
                        
id strval(tmp);
                        if(!
id || id 33) return SendClientMessage(playerid0xFFFFFFAA"{FFFFFF}Correct: /ochelari [1-33]");
                        
TextDrawShowForPlayer(playeridMsgBox);
                        
SetTimerEx("Hide"3500false"d"playerid);
                        if(
id 30) goto PutPoliceGlasses;
                        else
                        {
                            
id--;
                            
glasseid =  CommonRed id;
                            
SetPlayerHoldingObject(playeridglasseid2SkinOffSet[skin][0], SkinOffSet[skin][1], SkinOffSet[skin][2], SkinOffSet[skin][3], SkinOffSet[skin][4], SkinOffSet[skin][5]);
                            return 
1;
                        }
                        
PutPoliceGlasses:
                        
glasseid CopGlassesBlack + (id 31);
                        
SetPlayerHoldingObject(playeridglasseid2SkinOffSet[skin][0], floatadd(SkinOffSet[skin][1], 0.004500), SkinOffSet[skin][2], SkinOffSet[skin][3], SkinOffSet[skin][4], SkinOffSet[skin][5]);
                        return 
1;
                    } 
Reply
#2

Use IsPlayerInRangeOfPoint to use the command just in stores, and when you buy some glasses just remove some money with GivePlayerMoney.

PD: amazing signature. -.- (Scared me...)
Reply
#3

how can i make it so i buy glasses and then with my cmd i can do /glasses and i have same glasses that i bought get it?
EDIT:i want so if i buy glasses then when i type /glasses i have them anytime..only if i buy them..

PHP код:
if (strcmp("/glasses"cmdtexttrue10) == 0)
                    {
                    if(
glasses[playerid] == false)
                    {
                        
SetPlayerHoldingObject(playeridglasseid2SkinOffSet[skin][0], SkinOffSet[skin][1], SkinOffSet[skin][2], SkinOffSet[skin][3], SkinOffSet[skin][4], SkinOffSet[skin][5]);
                        
glasses[playerid] = true;
                    }
                    else if(
glasses[playerid] == true)
                    {
                        if(
IsPlayerAttachedObjectSlotUsed(playerid1)) RemovePlayerAttachedObject(playerid,1);
                        
glasses[playerid] = false;
                    }
                    return 
1;
                    } 
Reply
#4

No one will actually script it for you. Please learn some basics.

Some resources that will help you with scripting that feature:

https://sampwiki.blast.hk/
https://sampwiki.blast.hk/wiki/Scripting_Basics
https://sampwiki.blast.hk/wiki/Category:Scripting_Functions
https://sampwiki.blast.hk/wiki/Category:Scripting_Callbacks
https://sampwiki.blast.hk/wiki/Category:Tutorials
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
https://sampwiki.blast.hk/wiki/GivePlayerMoney
https://sampwiki.blast.hk/wiki/SetPlayerAttachedObject
https://sampwiki.blast.hk/wiki/EditAttachedObject

That's all you need.
Reply
#5

i know i dont know how to put so each glasses that i buy goes there at /glasses..
Reply
#6

I actually don't understand what you want but this may help you -

pawn Код:
if(glasses[playerid] == 1)
         {
         SendClientMessage(playerid, COLOR_WHITE, "You cannot hold more than a pair of glasses");
         {
Reply
#7

man this is what i want..if i buy a pair of glasses then i can do /glasses all the time with the same pair of glasses..
Reply
#8

man this is waht i want,
proper inglis thread zo i cann understund what yu actully mean here.

Get it?
Reply
#9

Quote:
Originally Posted by irinel1996
Посмотреть сообщение
Use IsPlayerInRangeOfPoint to use the command just in stores, and when you buy some glasses just remove some money with GivePlayerMoney.

PD: amazing signature. -.- (Scared me...)
You made me click. I need some eyebleach...
Reply
#10

Quote:
Originally Posted by dowster
Посмотреть сообщение
You made me click. I need some eyebleach...
damn signature. he made me close my browser with 8 tabs.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)