10.04.2013, 14:51
Toda vez que uso /editar entrada, so servidor desliga...
Detalhe: Ja tem nas scriptfiles os aquivos bizz e sbizz
PHP код:
if(strcmp(cmd, "/editar", true) == 0 && PlayerInfo[playerid][pAdmin] >= 5)
{
new Float:x,Float:y,Float:z,str[256];
GetPlayerPos(playerid, x,y,z);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "|________________________________________|");
SendClientMessage(playerid, COLOR_WHITE, "/editar [nome]");
SendClientMessage(playerid, COLOR_WHITE, "Nomes: entrada, nome");
SendClientMessage(playerid, COLOR_GREY, "|________________________________________|");
return 1;
}
if(strcmp(tmp, "entrada", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "/editar entrada <casa>");
return 1;
}
new house = strval(tmp);
HouseInfo[house][hEntrancex] = x;
HouseInfo[house][hEntrancey] = y;
HouseInfo[house][hEntrancez] = z;
DestroyPickup(HouseInfo[house][hIcon]);
HouseInfo[house][hIcon] = AddStaticPickup(1273, 1, x,y,z);
format(str, 256, "Casa editada: %d.", house);
SendClientMessage(playerid, COLOR_WHITE,str);
}
else if(strcmp(tmp, "nome", true) == 0)
{
for(new i=0;i<sizeof(HouseInfo);i++)
{
if(PlayerToPoint(3.0,playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez]))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "/editar nome <nome>");
return 1;
}
strmid(HouseInfo[i][hDiscription],tmp,0,strlen(tmp),255);
format(str, 256,"Nome da casa editado para '%s'", tmp);
SendClientMessage(playerid, COLOR_WHITE, str);
}
}
for(new i=0;i<sizeof(BizzInfo);i++)
{
if(PlayerToPoint(3.0,playerid,BizzInfo[i][bEntranceX],BizzInfo[i][bEntranceY],BizzInfo[i][bEntranceZ]))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "/editar nome <nome>");
return 1;
}
strmid(BizzInfo[i][bMessage],tmp,0,strlen(tmp),255);
format(str, 256,"Nome da empresa editado para '%s'", tmp);
SendClientMessage(playerid, COLOR_WHITE, str);
}
}
for(new i=0;i<sizeof(SBizzInfo);i++)
{
if(PlayerToPoint(3.0,playerid,SBizzInfo[i][sbEntranceX],SBizzInfo[i][sbEntranceY],SBizzInfo[i][sbEntranceZ]))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "/editar nome <nome>");
return 1;
}
strmid(SBizzInfo[i][sbMessage],tmp,0,strlen(tmp),255);
format(str, 256,"Nome da empresa editado para '%s'", tmp);
SendClientMessage(playerid, COLOR_WHITE, str);
}
}
}
else {
SendClientMessage(playerid, COLOR_GREY, "/editar [nome]");
return 1;
}
}