forward BotPos(BotPos, Float:X, Float:Y, Float:Z); public BotPos(BotPos, Float:X, Float:Y, Float:Z) { for(new b=0; b<MAX_PLAYERS; b++) { if(IsPlayerNPC(b)) { BotPos = GetPlayerPos(b, X, Y, Z); return 1; } } return 1; } CMD:findbot(playerid, params[]) { for(new i=0; i<MAX_PLAYERS; i++) { if(IsPlayerAdmin(i)) { SetPlayerPos(i, BotPos);//Error here SendClientMessage(i, -1, "You arrived successfully"); return 1; } else return SendClientMessage(playerid, -1, "You are not authorized to use that command!"); } return 1; }
error 076: syntax error in the expression, or invalid function call
stock BotPos(&Float:botX, &Float:botY, &Float:botZ) {
for(new b=0; b<MAX_PLAYERS; ++b) {
if(IsPlayerNPC(b)) {
GetPlayerPos(b, botX, botY, botZ);
break;
}
}
return 1;
}
CMD:findbot(playerid, params[]) {
for(new i=0; i<MAX_PLAYERS; ++i) {
if(IsPlayerAdmin(i)) {
new Float:X, Float:Y, Float:Z;
BotPos(X, Y, Z);
SetPlayerPos(i, X, Y, Z);
SendClientMessage(i, -1, "You arrived successfully");
}
else SendClientMessage(playerid, -1, "You are not authorized to use that command!");
}
return 1;
}
Parameters: (playerid,Float,Float:y,Float:z) |
CMD:findbot(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
for(new b=0; b<MAX_PLAYERS; b++)
{
if(IsPlayerNPC(b))
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(b, X, Y, Z);
}
}
SetPlayerPos(i, X, Y, Z);
SendClientMessage(i, -1, "You arrived successfully");
return 1;
}
else return SendClientMessage(playerid, -1, "You are not authorized to use that command!");
}
error 017: undefined symbol "X"
I already made this before! but what happened is::
I receive this error:: Код:
error 017: undefined symbol "X" thats why I made this "public BotPos" |
CMD:findbot(playerid, params[])
{
new Float:X,Float:Y,Float:Z;
if(IsPlayerAdmin(playerid))
{
for(new b=0; b<MAX_PLAYERS; b++)
{
if(IsPlayerNPC(b))
{
GetPlayerPos(b, X, Y, Z);
}
}
SetPlayerPos(i, X, Y, Z);
SendClientMessage(i, -1, "You arrived successfully");
return 1;
}
else return SendClientMessage(playerid, -1, "You are not authorized to use that command!");
}
I already made this before! but what happened is::
I receive this error:: Код:
error 017: undefined symbol "X" thats why I made this "public BotPos" |
CMD:findbot(playerid, params[]) {
if(!IsPlayerAdmin(i)) return 0; // Will return "Unknown Command" for non-admins.
new Float:X, Float:Y, Float:Z;
BotPos(X, Y, Z);
SetPlayerPos(playerid, X, Y, Z);
SendClientMessage(i, -1, "You arrived successfully");
return 1;
}
Look carefully, I didn't only change it to stock, I changed most of the things in the code.
|