#1

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

Explain this! A cow?
Reply
#3

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

That you are in the "cow".
Reply
#4

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

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

Can you make me this ?

But i will that my player is in the cow
Reply
#6

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

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

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 ?
Reply
#9

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)