New in dcmd- Help with meows!!!
#1

Good day, evening, morning, night, where ever you are!

Here is my code:
Код:
dcmd_buymeow(playerid, params[])
{
  new Money = GivePlayerMoney(playerid,-1000);
  new playername[MAX_PLAYER_NAME];
	GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
	new giveplayerid;
	if (sscanf(params, "u", giveplayerid))return SendClientMessage(playerid, 0x6495EDAAA, "Usage: /Buymeow [ID/Name]");
	else
	if (giveplayerid == INVALID_PLAYER_ID)return SendClientMessage(playerid, 0xFF9900AA, "Wrong name or ID!");
	else
 	if (IsPlayerConnected(playerid))
	{
		GivePlayerMoney(giveplayerid,Money);
        GivePlayerMoney(playerid,1000);
        SendClientMessage(giveplayerid,0x24FF0AB9, "You bought meows!!");
	 	SendClientMessage(playerid,0x24FF0AB9, "You have succesfully sold your meows");
 	 	SetPlayerDrunkLevel(giveplayerid, 3200);

 	}
	else
 	{
 	SendClientMessage(giveplayerid,0xAA0000AA,"This person doens't have Meow[playerid] = 50;");
 	}
	return 1;
}
Now, hard explanation:
Now every player is allowed to do /meow, and thats how its supposed to be.
But now its set like that, that you can do /meow ID, and you get meow, even if the player doesnt have "Meow"
So, what I want is that the player who you try to buy that meow from, HAVE TO HAVE "Meow[playerid] = 50;"
If the player you try to buy meow from does not have "Meow[playerid] = 50;", pops up that "This person doesn't have Meow[playerid] = 50;"

------------------------------------------------

Other explanation:
Here we have cat ID 1, dog ID 2 and snake ID 3. Now the cat has "Meow[playerid] = 50;". The snake has "Meow[playerid = 0;, and the dog has Meow[playerid] = 50; too." Now the dog wants to buy 50 Meow, first he tryis to write /buymeow 3, but he end up with message "This person doesn't have Meow[playerid] = 50;". Now the dog tryes again, now he do /buymeow 1, and the command works, he has succesfully bought 50 Meow.
Код:
if Meow[playerid] = 50;       ?
So, what do I have to add there, and where?

Dont judge me, im some in new scripting!

Regards,
Assyria =^_^=
Reply
#2

BUMP!
Reply
#3

I have no idea what you just said.
Reply
#4

Read carefully my explanations! :P
Reply
#5

Quote:
Originally Posted by Assyria
pawn Код:
dcmd_buymeow(playerid, params[])
{
    new giveplayerid;
    if (sscanf(params, "u", giveplayerid)) SendClientMessage(playerid, 0x6495EDAAA, "Usage: /Buymeow [ID/Name]");
    else if (giveplayerid == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF9900AA, "Wrong name or ID!");
    else if(Meow[giveplayerid] != 50) SendClientMessage(playerid, COLOR, "This person doesn't have Meow[playerid] = 50;");
    else
    {
         GivePlayerMoney(playerid,-1000);
         GivePlayerMoney(giveplayerid,1000);
         SendClientMessage(playerid,0x24FF0AB9, "You bought meows!!");
         SendClientMessage(giveplayerid,0x24FF0AB9, "You have succesfully sold your meows");
         Meow[giveplayerid] = 0;
         SetPlayerDrunkLevel(playerid, 3200);
    }
    return 1;
}
=D xD
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)