Little problem
#1

if(strcmp(cmd, "/givegcoin", true) == 0)
{
if(sscanf(cmd, "ud", giveplayerid, amount1)) return SendClientMessage(playerid, RED, "USAGE: /givegcoins [playerid] [Gold Coins]");

whats the wrong here ?
When i type /givegcoin my ID 1 it shows me


USAGE: /givegcoins [playerid] [Gold Coins]
Reply
#2

Show us the full command
Reply
#3

if(strcmp(cmd, "/givegcoin", true) == 0)
{
if(sscanf(cmd, "ud", giveplayerid, amount1)) return SendClientMessage(playerid, RED, "USAGE: /givegcoins [playerid] [Gold Coins]");
if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, RED, "ERROR: That player is not connected!");
if(giveplayerid == playerid) return SendClientMessage(playerid, RED, "ERROR: You cant send yourself coins!");
if(amount1 > PlayerInfo[playerid][pGoldcoin]) return SendClientMessage(playerid, RED, "ERROR: You dont have that amount of gold coins!");

new sstring[ 256 ];
new file[100],Name[MAX_PLAYER_NAME],Ip[16]; GetPlayerName(giveplayerid, Global_Name, sizeof(Global_Name));GetPlayerName(playerid,Name,s izeof(Name)); GetPlayerIp(playerid,Ip,sizeof(Ip)); format(file,sizeof(file),Name);
format(tmp, sizeof(tmp), "You have succesfully sent %d gold coins to %s(%d)!", amount1, Global_Name, playerid);
SendClientMessage(playerid, YELLOW, sstring);
format(tmp, sizeof(tmp), "%s(%d) has given to you %d amount of gold coins!", Name, playerid, amount1);
SendClientMessage(giveplayerid, YELLOW, sstring);
PlayerInfo[giveplayerid][pGoldcoin] += amount1;
PlayerInfo[playerid][pGoldcoin] -= amount1;
return 1;
}
Reply
#4

pawn Код:
if(sscanf(cmd, "ui", giveplayerid, amount1)) return SendClientMessage(playerid, RED, "USAGE: /givegcoins [playerid] [Gold Coins]");
Try this.
Reply
#5

you kidding me ?
its already added dude check weel the script
Код:
if(sscanf(cmd, "ud", giveplayerid, amount1)) return SendClientMessage(playerid, RED, "USAGE: /givegcoins [playerid] [Gold Coins]");

already added
Reply
#6

Quote:
Originally Posted by BigBaws
Посмотреть сообщение
you kidding me ?
its already added dude check weel the script
Код:
if(sscanf(cmd, "ud", giveplayerid, amount1)) return SendClientMessage(playerid, RED, "USAGE: /givegcoins [playerid] [Gold Coins]");

already added
Look carefully, you are missing a point.

pawn Код:
if(sscanf(cmd, "ud"
It must be "ui", not "ud".
Reply
#7

same problem when i type /givegcoin ID 1 it shows me
if(sscanf(cmd, "ui", giveplayerid, amount1)) return SendClientMessage(playerid, RED, "USAGE: /givegcoins [playerid] [Gold Coins]");
Reply
#8

Код:
format(tmp, sizeof(tmp), "You have succesfully sent %d gold coins to %s(%d)!", amount1, Global_Name, playerid);
Why don't you have it set to 'GetPlayerNameEx' ?
instead of having it
playerid? It's getting the player who typed the command, not who he gave it to.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)