Help -
NayanIndia - 15.01.2015
when i try to get id 0 ex /getid 0 error is id number 2 comes this is a bug how to fix it i am using zcmd and sscanf2
Re: Help -
ATGOggy - 15.01.2015
Code please
Re: Help -
NayanIndia - 15.01.2015
Код:
CMD:gethere(playerid, params[])
{
new giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /gethere [playerid]");
new Float:plocx,Float:plocy,Float:plocz;
if (IsPlayerConnected(giveplayerid))
{
if(PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin])
{
SendClientMessageEx(playerid, COLOR_WHITE, "You can't perform this action on an equal or higher level administrator.");
return 1;
}
if (PlayerInfo[playerid][pAdmin] >= 2)
{
if(GetPlayerState(giveplayerid) == PLAYER_STATE_SPECTATING)
{
SendClientMessageEx(playerid, COLOR_GRAD2, "That player is spectating someone.");
return 1;
}
GetPlayerPos(playerid, plocx, plocy, plocz);
Streamer_UpdateEx(giveplayerid, plocx, plocy, plocz);
SetPVarInt(playerid, "BeingTeleported", 1);
SetPlayerVirtualWorld(giveplayerid, PlayerInfo[playerid][pVW]);
PlayerInfo[giveplayerid][pLocal] = PlayerInfo[playerid][pLocal];
if (GetPlayerState(giveplayerid) == 2)
{
TelePos[giveplayerid][0] = 0.0;
TelePos[giveplayerid][1] = 0.0;
new tmpcar = GetPlayerVehicleID(giveplayerid);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
LinkVehicleToInterior(GetPlayerVehicleID(giveplayerid), GetPlayerInterior(playerid));
SetPlayerInterior(giveplayerid, GetPlayerInterior(playerid));
SetVehicleVirtualWorld(GetPlayerVehicleID(giveplayerid), GetPlayerVirtualWorld(playerid));
SetPlayerVirtualWorld(giveplayerid, GetPlayerVirtualWorld(playerid));
}
else
{
SetPlayerPos(giveplayerid,plocx,plocy+2, plocz);
SetPlayerInterior(giveplayerid, GetPlayerInterior(playerid));
SetPlayerVirtualWorld(giveplayerid, GetPlayerVirtualWorld(playerid));
}
SendClientMessageEx(giveplayerid, COLOR_GRAD1, " You have been teleported!");
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
}
}
else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
return 1;
}
Re: Help -
NayanIndia - 15.01.2015
help please help
Re: Help -
xVIP3Rx - 15.01.2015
pawn Код:
CMD:gethere(playerid, params[])
{
new giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /gethere [playerid]");
new str[128]; format(str, sizeof(str), "giveplayerid = %d", giveplayerid), SendClientMessage(playerid, -1, str);//For debugging, remove if worked
if (!IsPlayerConnected(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
if(PlayerInfo[giveplayerid][pAdmin] >= PlayerInfo[playerid][pAdmin]) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't perform this action on an equal or higher level administrator.");
if (PlayerInfo[playerid][pAdmin] < 2) return SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
if(GetPlayerState(giveplayerid) == PLAYER_STATE_SPECTATING) return SendClientMessageEx(playerid, COLOR_GRAD2, "That player is spectating someone.");
new Float:plocx,Float:plocy,Float:plocz;
GetPlayerPos(playerid, plocx, plocy, plocz);
Streamer_UpdateEx(giveplayerid, plocx, plocy, plocz);
SetPVarInt(playerid, "BeingTeleported", 1);
SetPlayerVirtualWorld(giveplayerid, PlayerInfo[playerid][pVW]);
PlayerInfo[giveplayerid][pLocal] = PlayerInfo[playerid][pLocal];
if (GetPlayerState(giveplayerid) == 2)
{
TelePos[giveplayerid][0] = 0.0;
TelePos[giveplayerid][1] = 0.0;
new tmpcar = GetPlayerVehicleID(giveplayerid);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
LinkVehicleToInterior(GetPlayerVehicleID(giveplayerid), GetPlayerInterior(playerid));
SetPlayerInterior(giveplayerid, GetPlayerInterior(playerid));
SetVehicleVirtualWorld(GetPlayerVehicleID(giveplayerid), GetPlayerVirtualWorld(playerid));
SetPlayerVirtualWorld(giveplayerid, GetPlayerVirtualWorld(playerid));
}
else
{
SetPlayerPos(giveplayerid,plocx,plocy+2, plocz);
SetPlayerInterior(giveplayerid, GetPlayerInterior(playerid));
SetPlayerVirtualWorld(giveplayerid, GetPlayerVirtualWorld(playerid));
}
return SendClientMessageEx(giveplayerid, COLOR_GRAD1, "You have been teleported!");
}
I added a debug to show you which "playerid" you typed.
Re: Help -
NayanIndia - 15.01.2015
i think should i update sscanf and zcmd ?
Re: Help -
ATGOggy - 15.01.2015
Try changing this"
PHP код:
if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /gethere [playerid]");
to this:
PHP код:
if(sscanf(params, "i", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /gethere [playerid]");
Also, I have the same code in my script. I'll post it here. If you want, you can edit it and use it.
PHP код:
dcmd_tptome(playerid, params[])
{
new pID, Float:adminx, Float:adminy, Float:adminz;
if(PlayerInfo[playerid][pAdmin]==0) return SendClientMessage(playerid, COLOR_WHITE,"Server: Unrecognized command, type /commands to see the commands available for you.");
if(PlayerInfo[playerid][pAdmin]==1) return SendClientMessage(playerid, COLOR_ADMINBLUE, "ERROR: This command is unavailable for your admin rank.");
if(admduty[playerid]==0) return SendClientMessage(playerid, COLOR_ADMINBLUE, "ERROR: You must be on duty to use this command.");
if(sscanf(params, "u", pID)) return SendClientMessage(playerid, COLOR_ADMINBLUE, "Correct usage: /tptome [name/id]");
if(playerid==pID) return SendClientMessage(playerid, COLOR_ADMINBLUE, "ERROR: The requested player is you.");
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_ADMINBLUE, "ERROR: This player is not connected.");
if(life[pID]==0) return SendClientMessage(playerid, COLOR_ADMINBLUE, "ERROR: This player has not spawned.");
if(PlayerInfo[pID][pAdmin]==10) return SendClientMessage(playerid, COLOR_ADMINBLUE, "ERROR: You cannot teleport AmalM to your location.");
GetPlayerPos(playerid, adminx, adminy, adminz);
SetPlayerVirtualWorld(pID,GetPlayerVirtualWorld(playerid));
SetPlayerInterior(pID,GetPlayerInterior(playerid));
if(IsPlayerInAnyVehicle(pID))
{
new vehicleid=GetPlayerVehicleID(pID);
SetVehiclePos(vehicleid, adminx, adminy+2, adminz);
}
else
{
SetPlayerPos(pID, adminx, adminy+2, adminz);
}
SendClientMessage(playerid, COLOR_ADMINBLUE, "The requested player has been teleported to your location successfully.");
SendClientMessage(pID, COLOR_ORANGE, "An admin has teleported you to his position.");
return 1;
}
Re: Help -
Thoma - 15.01.2015
its always best to have the up to date ones :P out of date plugins/includes may cause problems or cause somethings not to work
Re: Help -
xVIP3Rx - 15.01.2015
I don't think old versions have any issues like this, but you should update them once there's an update of-course.
Re: Help -
NayanIndia - 15.01.2015
yes let me update zcmd ad sscanf
Re: Help -
NayanIndia - 15.01.2015
new version have this bugs i thnk sscanf got this bug
Re: Help -
NayanIndia - 15.01.2015
now new bug i cant set player as faction leader

when i try to set him a leader for ex player id 1 want to be a fac leader it set player id 3 as a leader



Re: Help -
ATGOggy - 15.01.2015
Try changing "u" in sscanf to "i".
Re: Help -
NayanIndia - 15.01.2015
ok bro