Several cmds questions
#1

1.How to make when you write cmd, an animation starts.
I get warning in script line *ApplyAnimation(pla...* warning 202: number of arguments does not match definition
Код:
        if(!strcmp("/eat1", cmdtext,true))
    {
        if(!IsPlayerInRangeOfPoint(playerid, 2.0, 240.1804,1117.3380,1080.9922))return SendClientMessage(playerid, 0xFF9900AA,"You are not in /eat checkpoint.");
        {
        ApplyAnimation(playerid,"FOOD","EAT_Burger ",4.1,1,1,1,1,1,1);
        new Float:health;
		GetPlayerHealth(playerid,health);
		SetPlayerHealth(playerid, health+20);
        return 1;
        }
    }
I guess even then animation script is not right.

2.How to make when i write /countdown, it freezes only you, and i counts on screen from 5 to 0 and than unfreezes you.

Код:
    if(!strcmp("/countdown", cmdtext,true))
    {
        //script...
    }
3.This is complicated, so i hope i could explain to you in this way. I have no idea how to make script like that. -.-
if you write /steal, than cmd /sell works
if you didnt write /steal, than cmd /sell doesnt works
if you write /steal, than cmd /sell works, but you cant again /sell, than you must write again /steal to cmd /sell to work
Reply
#2

answer on 1st: check the number of parameters in apply animations
so https://sampwiki.blast.hk/wiki/ApplyAnimation
answer on 2nd: there are lots of countdowns scripts on the forums here and i dont have time to script it atm.
answer on 3th: use variables for example
on top of your script

Код:
new stolenthings;
then at ur /steal command or sumthing

Код:
    if(!strcmp("/steal", cmdtext,true))
    {
      if(stolenthings == 1) return SendClientMessage(playerid,0xFF9900AA,"You already stolen the things.");
     // bla bla bla sendclientmessage things etc...
     stolenthings = 1; // this on end so now you got stolenthings
to sell
Код:
 if(!strcmp("/sell", cmdtext,true))
    {
        if(stolenthings == 1) return SendClientMessage(playerid,0xFF9900AA,"You dont have things to sell.");
        // bla bla bla sendclientmessage things etc... again
     stolenthings = 0;
    }
no idea if this works :P this has been scripted on the forums so i didnt use pawno or summing :P
Reply
#3

I ofc checked forums, wiki for answer on my questions. ima newb scripter but, not an idiot -.-
1. Problem is animation doesnt work in any case, i deleted one parameter and i get no warnings, but animation still doesnt work. Do i need to define something or include?
2. Gonna check forums, i copied this kind of scripts from other modes and style it in my way, but kind a doenst work, so i wanted a fresh script for this.
3. Ok, ill try this.
Reply
#4

bump -.-
Reply
#5

for the countdown:
top of your script:
pawn Код:
new countdown;
on a command or something:

pawn Код:
countdown = 5
SetTimer("countdown",1000,true);
pawn Код:
forward countdown(playerid);
public countdown(playerid)
{
    countdown --;
    TogglePlayerControllable(playerid,0);
    new str[10];
    format(str,sizeof(str),"%d",countdown);
    SendClientMessage(playerid,color,str);
    if(countdown == 1)
    {
        SendClientMessage(playerid,colour,"GO GO GO!");
        return 1;
    }
}
untested but it sohuld work, if not you get the idea
Reply
#6

nejc001 did it work? what i gave you.. the countdown should work, mine too just this animation thing
EDIT: i think u need to add at my command new stolenthings[MAX_PLAYERS]; and at the stolenthings = 1; etc. add
[playerid] so it will look like stolenthings[playerid] = 1; for example
else if u dont do that and for example i steal something u wont be able to steal anymore... so thats why u gotta make it for each playerid
Reply
#7

where should i put
Код:
forward countdown(playerid);
public countdown(playerid)
{
    countdown --;
    TogglePlayerControllable(playerid,0);
    new str[10];
    format(str,sizeof(str),"%d",countdown);
    SendClientMessage(playerid,color,str);
    if(countdown == 1)
    {
        SendClientMessage(playerid,colour,"GO GO GO!");
        return 1;
    }
}
I though this shouldnt be in any category, but i get like 5 errors. so...

EDIT: Mike, i tryed ur script and i works just perfect. There were some problems, but i fixed it.
At this script should be *if(stolenthings == 0)*.
Код:
 if(!strcmp("/sell", cmdtext,true))
    {
        if(stolenthings == 0) return SendClientMessage(playerid,0xFF9900AA,"You dont have things to sell.");
        // bla bla bla sendclientmessage things etc... again
     stolenthings = 0;
    }
Whatever, ty.
Reply
#8

bump -.-
for my last post
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)