if(strcmp(cmd, "/asellhouse", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, playername, sizeof(playername));
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /asellhouse [houseid]");
return 1;
}
new house = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 4)
{
HouseInfo[house][hHel] = 0;
HouseInfo[house][hArm] = 0;
HouseInfo[house][hHealthx] = 0;
HouseInfo[house][hHealthy] = 0;
HouseInfo[house][hHealthz] = 0;
HouseInfo[house][hArmourx] = 0;
HouseInfo[house][hArmoury] = 0;
HouseInfo[house][hArmourz] = 0;
HouseInfo[house][hLock] = 1;
HouseInfo[house][hOwned] = 0;
HouseInfo[house][hVec] = 418;
HouseInfo[house][hVcol1] = -1;
HouseInfo[house][hVcol2] = -1;
strmid(HouseInfo[house][hOwner], "The State", 0, strlen("The State"), 255);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~You have sold this Casas", HouseInfo[house][hValue]);
GameTextForPlayer(playerid, string, 10000, 3);
OnPropUpdate();
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You are not an admin.");
}
}
return 1;
}
new Variable[11] = "1 2.5 Hola";
new entero, Float:decimal, string[5];
sscanf(Variable, "ifs[5]", entero, decimal, string);
zcmd(asellhouse, playerid, params[])
{
new string[256];
new playername[MAX_PLAYER_NAME];
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, playername, sizeof(playername));
if(!sscanf(params, "i", params[0]))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /asellhouse [houseid]");
return 1;
}
new house = params[1];
if (Informacion[playerid][pAdmin] >= 4)
{
HouseInfo[house][hHel] = 0;
HouseInfo[house][hArm] = 0;
HouseInfo[house][hHealthx] = 0;
HouseInfo[house][hHealthy] = 0;
HouseInfo[house][hHealthz] = 0;
HouseInfo[house][hArmourx] = 0;
HouseInfo[house][hArmoury] = 0;
HouseInfo[house][hArmourz] = 0;
HouseInfo[house][hLock] = 1;
HouseInfo[house][hOwned] = 0;
HouseInfo[house][hVec] = 418;
HouseInfo[house][hVcol1] = -1;
HouseInfo[house][hVcol2] = -1;
strmid(HouseInfo[house][hOwner], "The State", 0, strlen("The State"), 255);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "~w~You have sold this Casas", HouseInfo[house][hValue]);
GameTextForPlayer(playerid, string, 10000, 3);
OnPropUpdate();
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "You are not an admin.");
}
}
return 1;
}
if(sscanf(params, "i", params[0]))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /asellhouse [houseid]");
return 1;
}
if(sscanf(params, "i", params[0])) return SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /asellhouse [houseid]"),1;
if(!strlen(params) || !isNumeric(params)) return SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /asellhouse [houseid]"),1;
new houseid = strval(params);
Todo estб AQUI.
|
Todo estб AQUI.
|
Yo cuando era novato y estaba sscanf 1.0, no entendнa un pomo, aveces es necesario que te lo explique otro para poder entenderlo mejor. |