"Command not Found" - TheLegend1 - 20.09.2015
hey fellas.
Well im trying to make a command which allows players to unload their money from their own bizzes.
But the problem is when i go at Biz Enterance it shows me " unknown command" if i try it anywhere else it works till it says that i need to be at biz enterance. any idea pls help me
HTML Code:
COMMAND:getmoneyfrombiz(playerid, params[])
{
new carid = GetPlayerVehicleID(playerid);
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER || IsPlayerInVehicle(playerid, 428))
return SendClientError(playerid, "You are not driving the moneyvan!");
for(new i; i < sizeof(biz); i++)
{
new f = i;
if(IsPlayerInRangeOfPoint(playerid, 7.0, biz[f][bizenter_x],biz[f][bizenter_y],biz[f][bizenter_z]) && biz[f][biztype] != 1)
{
new nomefile[ 50 ], fowner[ MAX_STRING ];
format(nomefile,sizeof(nomefile),"Businesses/%s.txt",biz[f][bizname]);
myStrcpy(fowner, dini_Get(nomefile,"owner"));
if(strcmp(PlayerName(playerid),fowner,false)==0 || PlayerInfo[playerid][power] > 10)
{
new tmpcash = dini_Int(nomefile,"bizcash"), tax;
if(tmpcash < 0) return SendClientError(playerid, "no cash!");
new iTax = dini_Int(nomefile,"taxrate");
if(iTax) tax=(tmpcash*dini_Int(nomefile,"taxrate")/70);
tmpcash=tmpcash-tax;
compscar[carid]=compscar[carid]+tmpcash;
dini_IntSet(nomefile,"bizcash",0);
SendClientMSG(playerid, COLOR_RED, " $%d from the business %s has been loaded into the van. (-$%d taxes)", compscar[carid], NoUnderscore(biz[i][biztext]), tax);
//SendClientMessageToAll(COLOR_LIGHTBLUE,"..: Security Van on Duty :..");
format(iStr,sizeof(iStr),"[BIZ] %s withdrawn $%d from his biz %s ID %d",PlayerName(playerid),compscar[carid],biz[i][bizname],i);
AppendTo(moneylog,iStr);
format(iStr, sizeof(iStr), "7[LOADMONEY] %s has loaded $%d from their business.", PlayerName(playerid), compscar[carid]);
iEcho(iStr);
}
else return SendClientError(playerid, "You don't own this business!");
}
}
return 1;
}
Re: "Command not Found" -
Andre02 - 20.09.2015
Try this:
pawn Code:
COMMAND:getmoneyfrombiz(playerid, params[])
{
new carid = GetPlayerVehicleID(playerid);
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER || IsPlayerInVehicle(playerid, 428))
return SendClientError(playerid, "You are not driving the moneyvan!");
for(new i; i < sizeof(biz); i++)
{
new f = i;
if(IsPlayerInRangeOfPoint(playerid, 7.0, biz[f][bizenter_x],biz[f][bizenter_y],biz[f][bizenter_z]) == 1 && biz[f][biztype] != 1)
{
new nomefile[ 50 ], fowner[ MAX_STRING ];
format(nomefile,sizeof(nomefile),"Businesses/%s.txt",biz[f][bizname]);
myStrcpy(fowner, dini_Get(nomefile,"owner"));
if(strcmp(PlayerName(playerid),fowner,false)==0 || PlayerInfo[playerid][power] > 10)
{
new tmpcash = dini_Int(nomefile,"bizcash"), tax;
if(tmpcash < 0) return SendClientError(playerid, "no cash!");
new iTax = dini_Int(nomefile,"taxrate");
if(iTax) tax=(tmpcash*dini_Int(nomefile,"taxrate")/70);
tmpcash=tmpcash-tax;
compscar[carid]=compscar[carid]+tmpcash;
dini_IntSet(nomefile,"bizcash",0);
SendClientMSG(playerid, COLOR_RED, " $%d from the business %s has been loaded into the van. (-$%d taxes)", compscar[carid], NoUnderscore(biz[i][biztext]), tax);
//SendClientMessageToAll(COLOR_LIGHTBLUE,"..: Security Van on Duty :..");
format(iStr,sizeof(iStr),"[BIZ] %s withdrawn $%d from his biz %s ID %d",PlayerName(playerid),compscar[carid],biz[i][bizname],i);
AppendTo(moneylog,iStr);
format(iStr, sizeof(iStr), "7[LOADMONEY] %s has loaded $%d from their business.", PlayerName(playerid), compscar[carid]);
iEcho(iStr);
}
else return SendClientError(playerid, "You don't own this business!");
}
}
return 1;
}
Re: "Command not Found" - TheLegend1 - 20.09.2015
Still same thing
Re: "Command not Found" -
thefirestate - 20.09.2015
Try this
Code:
COMMAND:getmoneyfrombiz(playerid, params[])
{
new carid = GetPlayerVehicleID(playerid);
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER || !IsPlayerInVehicle(playerid) || carid != 428) return SendClientMessage(playerid, -1, "You are not driving the moneyvan!");
for(new i; i < sizeof(biz); i++)
{
new f = i;
if(IsPlayerInRangeOfPoint(playerid, 7.0, biz[f][bizenter_x],biz[f][bizenter_y],biz[f][bizenter_z]) && biz[f][biztype] != 1)
{
new nomefile[ 50 ], fowner[ MAX_STRING ];
format(nomefile,sizeof(nomefile),"Businesses/%s.txt",biz[f][bizname]);
myStrcpy(fowner, dini_Get(nomefile,"owner"));
if(strcmp(PlayerName(playerid),fowner,false)==0 || PlayerInfo[playerid][power] > 10)
{
new scmb[100];
new tmpcash = dini_Int(nomefile,"bizcash"), tax;
if(tmpcash < 0) return SendClientError(playerid, "no cash!");
new iTax = dini_Int(nomefile,"taxrate");
if(iTax) tax=(tmpcash*dini_Int(nomefile,"taxrate")/70);
tmpcash=tmpcash-tax;
compscar[carid]=compscar[carid]+tmpcash;
dini_IntSet(nomefile,"bizcash",0);
format(scmb, sizeof(scmb)," $%d from the business %s has been loaded into the van. (-$%d taxes)", compscar[carid], NoUnderscore(biz[i][biztext]), tax);
SendClientMessage(playerid, COLOR_RED, scmb);
//SendClientMessageToAll(COLOR_LIGHTBLUE,"..: Security Van on Duty :..");
format(iStr,sizeof(iStr),"[BIZ] %s withdrawn $%d from his biz %s ID %d",PlayerName(playerid),compscar[carid],biz[i][bizname],i);
AppendTo(moneylog,iStr);
format(iStr, sizeof(iStr), "7[LOADMONEY] %s has loaded $%d from their business.", PlayerName(playerid), compscar[carid]);
iEcho(iStr);
}
else return SendClientError(playerid, "You don't own this business!");
}
}
return 1;
}
Re: "Command not Found" -
khRamin78 - 20.09.2015
or maybe you are not using
PHP Code:
OnPlayerCommandText(playerid, cmdtext[])
{
return 1; \\ this should return 1
}
maybe
Re: "Command not Found" - TheLegend1 - 28.09.2015
Still need help pls
Re: "Command not Found" -
Nixtren - 28.09.2015
Use the plugin CrashDetect to troubleshoot this problem more accurately. Get back to us once you run your server again and issue the command that is giving the error. Don't forget to post here what CrashDetect said