|
In that case, your current implementation looks fine.
Unless of course you want to adjust the amount of ranks and make it dynamic. In which case you'd create another table for just ranks with this schema: (rank precedence, rank name, faction ID) Then you can grab all the ranks with a SELECT * FROM ranks WHERE factionID = etc... you can have n ranks for every faction, adjust that limit based on some other factor whenever you want and you also have a record for each individual rank allowing you to build other data models around this (for example, you could link a player to a rank and a vehicle to a rank then the lookup becomes a JOIN between those three relations). |
|
Anyone knows the ID of the sound that plays on single player when you purchase a house?
I mean this: https://www.youtube.com/watch?v=qBbRd4o1suY |
|
1.
2. What you think it is better: when you enter in a pickup for a house to automatically teleport you or to enter manually by pressing a key? |
|
Is there an anti cheat for an invisible player cheat? Or, what method can I use to detect it?
|
CMD:setstyle(playerid, params[])
{
new
options, chatstyle, walkstyle;
if(sscanf(params, "d", options)) {
SendClientMessage(playerid, ADM, "USAGE:{FFFFFF} /setstyle [Options]");
SendClientMessage(playerid, DARKGREEN, "1. Chat Style|2. Walk Style");
return 1;
}
switch(options)
{
case 1:
{
if(sscanf(params, "d", chatstyle)){
SendClientMessage(playerid, DARKGREEN, "USAGE: /setstyle 1 [StyleID 0-7]");
return 1;
}
if(chatstyle < 0 || chatstyle > 7)
return SendClientMessage(playerid, DARKGREEN, "That chatstyle does not exist.");
PlayerData[playerid][ChatStyle] = chatstyle;
SendClientMessage(playerid, YELLOW, "Your chatstyle has been updated. Chat styles are played when you type.");
}
}
return 1;
}
First you are asking to put "params" into "options" and it should basically be a 1 or a 2. Then when it's a 1, you're asking again if params (aka also options) to be placed into chatstyle. Ergo you have the same thing being placed in both "options" and "chatstyle". You could make the code a bit simpler by using it like this for example:CMD:setstyle(playerid, params[])
{
new options, style;
if(sscanf(params, "ii", options, style)) {
SendClientMessage(playerid, ADM, "USAGE:{FFFFFF} /setstyle [Options] [StyleID]");
SendClientMessage(playerid, DARKGREEN, "1. Chat Style|2. Walk Style");
return 1;
}
switch(options)
{
case 1:
{
if(chatstyle < 0 || chatstyle > 7)
return SendClientMessage(playerid, DARKGREEN, "That chatstyle does not exist.");
PlayerData[playerid][ChatStyle] = chatstyle;
SendClientMessage(playerid, YELLOW, "Your chatstyle has been updated. Chat styles are played when you type.");
}
}
return 1;
}
CMD:setstyle(playerid, params[])
{
new options, style;
if(sscanf(params, "iI(-1)", options, style)) {
SendClientMessage(playerid, ADM, "USAGE:{FFFFFF} /setstyle [Options] [StyleID]");
SendClientMessage(playerid, DARKGREEN, "1. Chat Style|2. Walk Style");
return 1;
}
switch(options)
{
case 1:
{
if(style == -1) // this means that the user never placed any style id as parameter
{
SendClientMessage(playerid, DARKGREEN, "USAGE: /setstyle 1 [StyleID 0-7]");
return 1;
}
if(chatstyle < 0 || chatstyle > 7)
return SendClientMessage(playerid, DARKGREEN, "That chatstyle does not exist.");
PlayerData[playerid][ChatStyle] = chatstyle;
SendClientMessage(playerid, YELLOW, "Your chatstyle has been updated. Chat styles are played when you type.");
}
}
return 1;
}
CMD:wi(playerid, params[]) return cmd_windows(playerid, params);
CMD:win(playerid, params[]) return cmd_windows(playerid, params);
CMD:wind(playerid, params[]) return cmd_windows(playerid, params);
CMD:windo(playerid, params[]) return cmd_windows(playerid, params);
CMD:window(playerid, params[]) return cmd_windows(playerid, params);
CMD:windows(playerid, params[])
{
return 1;
}
for(new i = 1; i <= 3; i++)
{
if(PlayerData[playerid][Weapon][i])
format(string, sizeof(string), "%s[ %d. %s ]", ff, ff, ff, ff);
else
return 1;
}
SendClientMessage(playerid, WHITE, string);
new result = (amount / 100) * percentage;
if(strfind(BizData[business][bizOwner], BizData[business][bizOwner], true) != -1)
|
How can I check if a player is online using strfind?
For example, I tried checking if: PHP Code:
|
GetBusinessOwnerPlayerID(businessid)
{
if(businessid < 0 || businessid > MAX_BUSINESSES || BizData[businessid][bizValid] == false)
return false;
new local_playerName[MAX_PLAYER_NAME];
for(new i; i <= GetPlayerPoolSize(); i++)
{
GetPlayerName(i, local_playerName[i], MAX_PLAYER_NAME);
if(strcmp(local_playerName[i], BizData[businessid][bizOwner], true) == 0)
{
return i;
}
}
return INVALID_PLAYER_ID;
}
error 047: array sizes do not match, or destination array is too small
enum E_NUM{
carOwner[128],
carPlates[32],
};
stock LoadCars()
{
new
string[128], FileName[128];
for(new i = 0; i < MAX_PLAYER_VEHICLES; i++)
{
format(FileName, sizeof(FileName), "PlayerVehicles/%d.ini", i);
if(fexist(FileName)){
CarData[i][carOwner] = dini_Get(FileName, "carOwner");
CarData[i][carPlates] = dini_Get(FileName, "carPlates");