I need ONE HELP.. Please
#1

Quote:

public OnPlayerCommandText(playerid, cmdtext[]) {
new
cmd[256], tmp[256], idx,
p_name[MAX_PLAYER_NAME], o_name[MAX_PLAYER_NAME]
;
cmd = strtok(cmdtext, idx);
if(strcmp("/dlicense", cmd, true) == 0) {
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid, -1, "USAGE: /dlicense [ID]");
new ID = strval(tmp);
if(ID == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "SERVER: playerid isn't connected!");
GetPlayerName(ID, o_name, sizeof(o_name));
GetPlayerName(playerid, p_name, sizeof(p_name));
//Do your code here, getting the playerid his INI file and checking if he owns a LICENSE!
printf("LICENSE: [%d]%s showed [%d]%s his license.", playerid, p_name, ID, o_name);
return 1;
}
return 0;
}

stock strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}

new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}

What code i must write there? Where is typed: //Do your code here, getting the playerid his INI file and checking if he owns a LICENSE!
Please?
Reply


Messages In This Thread
(HELP) Read file from scriptfiles folder into game - by spaty2 - 13.07.2011, 19:44
Re: I need ONE HELP.. Please - by spaty2 - 13.07.2011, 20:35
Re: I need ONE HELP.. Please - by crowb14 - 13.07.2011, 21:06
(HELP) Read from file to Game - by spaty2 - 13.07.2011, 21:12

Forum Jump:


Users browsing this thread: 1 Guest(s)