error with command /pay -
Shellegg - 30.03.2009
pawn Код:
if(strcmp(cmd, "/pay", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "/pay [playerid/PartOfName] [amount]");
return 1;
}
//giveplayerid = strval(tmp);
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "/pay [playerid/PartOfName] [amount]");
return 1;
}
new moneys,playermoney;
moneys = strval(tmp);
if(PlayerInfo[playerid][pAdmin] < 1)
{
if(moneys > 999999999 && PlayerInfo[playerid][pLevel] < 5)
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "You need to be level 5 to make that transition.");
return 1;
}
}
if(moneys < 1 || moneys > 999999999)
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "Invбlid Ammount");
return 1;
}
if (IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if (ProxDetectorS(5.0, playerid, giveplayerid))
{
if(giveplayerid != playerid)
{
playermoney = GetPlayerCash(playerid);
if (moneys > 0 && playermoney >= moneys)
{
GivePlayerCash(playerid, (0 - moneys));
GivePlayerCash(giveplayerid, moneys);
format(string, sizeof(string), "You gave %s(Player: %d), %d$.", moneys, GetPlayerNameEx(giveplayerid),giveplayerid);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "You recieved %d$ from %s(Player: %d).",GetPlayerNameEx(playerid), playerid,moneys);
SendClientMessage(giveplayerid, COLOR_WHITE, string);
format(string, sizeof(string), "%s payed %d$ a %s", GetPlayerNameEx(playerid), moneys, GetPlayerNameEx(giveplayerid));
PayLog(string);
PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);
PlayerPlayerActionMessage(playerid,giveplayerid,5.0,"%s takes out his wallet and gives some cash to %s.");
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "Invбlid ammount");
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "You can't pay to yourself dumbass!");
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "You're to far away.");
}
}//invalid id
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "Invбlid ID");
}
}
return 1;
}
for some reason this command is crashing my server, not my game, but my server, is there any error?
Re: error with command /pay -
Shellegg - 30.03.2009
no1?
Re: error with command /pay -
Shellegg - 30.03.2009
Damn, anyone?
Re: error with command /pay -
Shellegg - 30.03.2009
alo?
Re: error with command /pay -
Flag - 30.03.2009
post the function from PlayerPlayerActionMessage(playerid,giveplayerid,5. 0,"%s takes out his wallet and gives some cash to %s.");
Re: error with command /pay -
Shellegg - 30.03.2009
pawn Код:
public PlayerPlayerActionMessage(playerid,targetid,Float:radius,message[])
{
//This is for messages like "Blah has opened the door for Steve".
new string[128];
format(string, sizeof(string), "%s %s %s.", GetPlayerNameEx(playerid), message,GetPlayerNameEx(targetid));
ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
PlayerActionLog(string);
return 1;
}
I use this fuction to other comands at they dont crash my server :/
Re: error with command /pay -
Shellegg - 31.03.2009
Still waiting...
Re: error with command /pay -
MenaceX^ - 31.03.2009
Stop these tripple posting..
Go to GF topic.
Re: error with command /pay -
Shellegg - 31.03.2009
It's not GF damit, if i'm posting because this sh1t crash my server.
But its i'll not post for this anymore.
Re: error with command /pay -
MenaceX^ - 31.03.2009
It doesn't matter if your game mode is not GF. This command is taken from GF.