11.12.2014, 18:03
Como faзo pra deixar esse comando aqui em cmdtext, nгo sei como chama esse aqui que uso, exemplo do que quero trocar:
esse ae й sу um exemplo do que eu quero mudar, pois nгo sei como mudar, quero mudar esse codigo aqui :
pawn Код:
if(strcmp(cmd,"/cativeiro",true) == 0)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_123,"USE: /cativeiro [Id] [tempo");
return true;
}
new org = GetPlayerOrg(playerid);
new para1;
new time;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext,idx);
time = strval(tmp);
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
if(ProxDetectorS(3.0,playerid,giveplayerid))
{
if(PlayerInfo[para1][pMembro] == 6||PlayerInfo[para1][pLider] == 6)
{
SendClientMessage(playerid,COLOR_GRAD1,"Vocк nгo pode prender um terrorista no cativeiro.");
return true;
}
GetPlayerName(para1,giveplayer,sizeof(giveplayer));
GetPlayerName(playerid,sendername,sizeof(sendername));
if ((org == 6) && PlayerToPoint(2.0, playerid,-1104.1871,-1666.2097,76.4672))
{
ProxDetector(30.0,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
PlayerInfo[para1][pJailed] = 4;
PlayerInfo[para1][pJailTime] = time*60;
PlayerInfo[para1][pPnumber] = 0;
Telefoneoff[para1] = 1;
ResetPlayerWeapons(para1);
SetPlayerPos(para1,-1104.1200,-1664.0133,76.4672);
SetCameraBehindPlayer(para1);
}
return true;
}
else
{
SendClientMessage(playerid,COLOR_GRAD1," Vocк nгo esta proximo ao cara.");
}
}
}
}
pawn Код:
CMD:boombox(playerid, params[])
{
new string[128];
if(!GetPVarType(playerid, "BoomboxObject"))
{
if(sscanf(params, "s[256]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /boombox [music url]");
foreach(Player, i)
{
if(GetPVarType(i, "BoomboxObject"))
{
if(IsPlayerInRangeOfPoint(playerid, 30.0, GetPVarFloat(i, "bposX"), GetPVarFloat(i, "bposY"), GetPVarFloat(i, "bposZ")))
{
SendClientMessage(playerid, COLOR_GREY, " There is another boombox nearby, place yours somewhere else.");
return 1;
}
}
}
new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, a);
SetPVarInt(playerid, "BoomboxObject", CreateDynamicObject(2103, x, y, z, 0.0, 0.0, 0.0, .worldid = GetPlayerVirtualWorld(playerid), .interiorid = GetPlayerInterior(playerid)));
SetPVarFloat(playerid, "bposX", x); SetPVarFloat(playerid, "bposY", y); SetPVarFloat(playerid, "bposZ", z);
SetPVarInt(playerid, "bboxareaid", CreateDynamicSphere(x, y, z, 30.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)));
format(string, sizeof(string), " You have placed your boombox at your location.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
foreach(Player, i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "bboxareaid")))
{
PlayAudioStreamForPlayer(i, params, GetPVarFloat(playerid, "bposX"), GetPVarFloat(playerid, "bposY"), GetPVarFloat(playerid, "bposZ"), 30.0, 1);
}
}
SetPVarString(playerid, "BoomboxURL", params);
}
else
{
DestroyDynamicObject(GetPVarInt(playerid, "BoomboxObject"));
DeletePVar(playerid, "BoomboxObject"); DeletePVar(playerid, "BoomboxURL");
DeletePVar(playerid, "bposX"); DeletePVar(playerid, "bposY"); DeletePVar(playerid, "bposZ");
if(GetPVarType(playerid, "bboxareaid"))
{
foreach(Player,i)
{
if(IsPlayerInDynamicArea(i, GetPVarInt(playerid, "bboxareaid")))
{
StopAudioStreamForPlayer(i);
SendClientMessage(i, COLOR_GREY, " The boombox creator has removed his boombox.");
}
}
DeletePVar(playerid, "bboxareaid");
}
SendClientMessage(playerid, COLOR_LIGHTBLUE, " You have removed your boombox.");
}