08.07.2010, 18:47
pawn Код:
if(strcmp(x_nr,"drugs",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /anna drugs [playerid/PartOfName] [amount]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(giveplayerid,x,y,z);
if(!PlayerToPoint(5, playerid, x, y, z))
{
SendClientMessage(playerid, COLOR_GRAD1, " Player is not near you!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /anna drugs [playerid/PartOfName] [amount]");
return 1;
}
new asammount;
asammount = strval(tmp);
if(asammount >= PlayerInfo[playerid][pDrugs]) { SendClientMessage(playerid, COLOR_GREY, " You don't have so many drugs."); return 1; }
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
PlayerInfo[playerid][pDrugs] -= asammount;
PlayerInfo[giveplayerid][pDrugs] += asammount;
if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his sack with drugs and hands it to %s.", sendername, giveplayer); }
else { format(string, sizeof(string), "* %s takes out her sack with drugs and hands it to %s.", sendername, giveplayer); }
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Player is Offline!");
return 1;
}
}
else if(strcmp(x_nr,"mats",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /anna mats [playerid/PartOfName] [amount]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(giveplayerid,x,y,z);
if(!PlayerToPoint(5, playerid, x, y, z))
{
SendClientMessage(playerid, COLOR_GRAD1, " Player is not near you!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /anna mats [playerid/PartOfName] [amount]");
return 1;
}
new adammount;
adammount = strval(tmp);
if(adammount >= PlayerInfo[playerid][pMats]) { SendClientMessage(playerid, COLOR_GREY, " You don't have so many mats."); return 1; }
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
PlayerInfo[playerid][pMats] -= adammount;
PlayerInfo[giveplayerid][pMats] += adammount;
if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s vхtab taskust matsid ja ulatab matsid %s.", sendername, giveplayer); }
else { format(string, sizeof(string), "* %s vхtab taskust matsid ja ulatab matsid %s.", sendername, giveplayer); }
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Mдngija ei ole aktiivine!");
return 1;
}
}
But how disable it? It's same with mats (materials)