SA-MP Forums Archive
Cow. - 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: Cow. (/showthread.php?tid=341071)



Cow. - Edin Black - 09.05.2012

Hello guys. I have a problem.

pawn Код:
if(strcmp(cmd, "/cow, true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
      tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_DGOLD, "
KORISTENJE: /cow [ID/DioImena]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if (PlayerInfo[playerid][pAdmin] >= 4)
            {
                if(IsPlayerConnected(giveplayerid))
                {
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {
                        SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_USEJETPACK); // Change playerid to giveplayerid
                        return 1;
                    }
                }//not connected
            }
            else
            {
                format(string, sizeof(string), "
  %d nije aktivan igrac.", giveplayerid);
                SendClientMessage(playerid, COLOR_GRAD1, string);
            }
        }
        return 1;
    }
With this command i will make a cow. Not a jetpack, i will make a cow, but who ?
/cow [ID] and you are a cow.


Re: Cow. - HDFord - 09.05.2012

Explain this! A cow?


Re: Cow. - Edin Black - 09.05.2012

So.
http://i.imgur.com/8t1lv.jpg

That you are in the "cow".


Re: Cow. - HDFord - 09.05.2012

Ok that is just attaching a object to the player i think. what is actually the cow a object or a action?


Re: Cow. - Edin Black - 09.05.2012

Hmm i donґt know. I mean a object.

Can you make me this ?

But i will that my player is in the cow


Re: Cow. - HDFord - 09.05.2012

Yes i can make it i just need to find out if it's a object or a action. I'll search around a little and send you a PM with the finished script
And i dont know how to make this in strcmp so i'll use zcmd!


Re: Cow. - kaisersouse - 09.05.2012

The main part of my /cow command (from old Everystuff)

Up at top
Код:
new cow[MAX_PLAYERS];
In command
Код:
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
cow[playerid] = CreateObject(11470,x,y,z-2,0.0,0.0,0.0);
AttachObjectToPlayer(cow[playerid], playerid, 0.0, 0.0, 4.0, 0.0, 0.0, 0.0);
In OnPlayerSpawn, OnPlayerDisconnect, or any other area where you want to remove the cow (maybe /nocow command)
Код:
if(cow[playerid])
{ 
    DestroyObject(cow[playerid]);
    cow[playerid] = 0;
}
MAKE SURE YOU REMOVE THE COW WHEN THEY LEAVE AT THE VERY LEAST.


Re: Cow. - Edin Black - 09.05.2012

Is this right ?

I put this in the command:
pawn Код:
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
cow[playerid] = CreateObject(11470,x,y,z-2,0.0,0.0,0.0);
AttachObjectToPlayer(cow[playerid], playerid, 0.0, 0.0, 4.0, 0.0, 0.0, 0.0);
I do not need coordinates from x,y,z ?


Re: Cow. - HDFord - 09.05.2012

Ok then it looks like you have your code no need for me then


Re: Cow. - kaisersouse - 09.05.2012

The GetPlayerPos gets the coords and puts them in x, y, and z. You only need to declare them, GetPlayerPos will fill them in.

Then you pass x, y, and z on to whatever you want to pass it to.

The x,y,z in AttachObjectToPlayer is the offset from the player's coords...not actual coords themselves.