CMD:extortion(playerid, params[]) { if(IsPlayerConnected(playerid)) { new string[128]; new businesstype[128]; new tmp[128], idx, cmd[128]; new id = PlayerInfo[playerid][pPbiskey]; format( string, sizeof( string ), "Businesses/Business_%d.ini", id); if(!dini_Exists(string)) { SendClientMessage( playerid, COLOR_GREY, " You don't own a Business!" ); return 1; } tmp = strtok(params, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /extortion [PlayerID/PartOfName] (or 555 for Nobody)"); return 1; } giveplayerid = ReturnUser(tmp); if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { GetPlayerName(playerid, sendername, sizeof(sendername)); GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); format(string, sizeof(string), "* %s is know Extortioning your Business.",giveplayer); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* %s has adjusted his Business, you are now Extortioning his Business.",sendername); SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "%s",giveplayer); strmid(BizzInfo[id][bExtortion], string, 0, sizeof(string), 255); format(string, sizeof(string), "Business Extortion Name set to %s",BizzInfo[id][bExtortion]); SaveBusiness(id); SendClientMessage(playerid, COLOR_WHITE, string); } } else if(giveplayerid == 555) { format(string, sizeof(string), "Nobody"); strmid(BizzInfo[id][bExtortion], string, 0, sizeof(string), 255); format(string, sizeof(string), "Business Extortion Name set to %s",BizzInfo[id][bExtortion]); SaveBusiness(id); SendClientMessage(playerid, COLOR_WHITE, string); } else { SendClientMessage(playerid, COLOR_GREY, "Invalid ID!"); return 1; } } return 1; }
new giverplayerid = INVALID_PLAYER_ID;
new sendername[MAX_PLAYER_NAME];
this line here is coming up the error giveplayerid = ReturnUser(tmp);
and same with this one GetPlayerName(playerid, sendername, sizeof(sendername)); |
CMD:extortion(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
new string[128];
//new businesstype[128]; what is this ?
new giveplayerid ;
new Index, tmp[256]; //idx shoule be Index in zcmd
new id = PlayerInfo[playerid][pPbiskey];
format( string, sizeof( string ), "Businesses/Business_%d.ini", id);
if(!dini_Exists(string))
{
SendClientMessage( playerid, COLOR_GREY, " You don't own a Business!" );
return 1;
}
tmp = strtok(params,Index);
if(isnull(tmp)) // should be isnull in ZCMD
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /extortion [PlayerID/PartOfName] (or 555 for Nobody)");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
new sendername[MAX_PLAYER_NAME];
new giveplayer[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "* %s is know Extortioning your Business.",giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s has adjusted his Business, you are now Extortioning his Business.",sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "%s",giveplayer);
strmid(BizzInfo[id][bExtortion], string, 0, sizeof(string), 255);
format(string, sizeof(string), "Business Extortion Name set to %s",BizzInfo[id][bExtortion]);
SaveBusiness(id);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
else if(giveplayerid == 555)
{
format(string, sizeof(string), "Nobody");
strmid(BizzInfo[id][bExtortion], string, 0, sizeof(string), 255);
format(string, sizeof(string), "Business Extortion Name set to %s",BizzInfo[id][bExtortion]);
SaveBusiness(id);
SendClientMessage(playerid, COLOR_WHITE, string);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Invalid ID!");
return 1;
}
}
return 1;
}