05.03.2009, 17:16
Quote:
Originally Posted by NigNog1
I find that hard to beleive that you successfully tested it. It still won't work.
|
I don't see anything wrong
Originally Posted by NigNog1
I find that hard to beleive that you successfully tested it. It still won't work.
|
RPName(playerid)
{
new n[24];
GetPlayerName(playerid,n,24);
for(new i=0;i<strlen(n);i++)
if(n[i]=='_') n[i]=' ';
return n;
}
Code:
RPName(playerid) { new n[MAX_PLAYER_NAME], i = -1; GetPlayerName(playerid, n, MAX_PLAYER_NAME); for (new i = 0, j = strlen(n); i < j; i++) { if (n[i] == '_') { n[i] = ' '; } } return n; } // native function strlen(const str[]) { new i = 0; while (str[i]) { i++; } return i; } |
forward OnPlayerAtCmd(playerid, cmdtext[]);
if(text[0] == '@') {OnPlayerAtCmd(playerid, text[1]); return 0;}
public OnPlayerAtCmd(playerid, cmdtext[])
{
new idx;
new string[128];
new sendername[MAX_PLAYER_NAME];
new giveplayer[MAX_PLAYER_NAME];
new cmd[128];
new tmp[128];
new giveplayerid;
cmd[idx] = cmdtext[0]; // this is important - it's what lets you *not* have the whole command and enter the name right after '@'
//The rest except the one above line is pretty much usual PM stuff. This sample is from GodFather (sorry, haters :))
//Also, I'm not sure, but I think that [idx] and [0] can be different. I tried replacing [0] with [1] and [2], but no change whatsoever.
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COL_HELP, "USAGE: @[Player ID/Name] [Message]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (IsPlayerConnected(giveplayerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COL_HELP, "USAGE: @[Player ID/Name] [Message]");
return 1;
}
format(string, sizeof(string), "New reply from %s (ID: %d): '%s'", sendername, playerid, (result));
SendClientMessage(giveplayerid, COL_REPLY, string);
return 1;
} else {
SendClientMessage(giveplayerid, COL_ERROR, "Recipient not online");
}
return 1;
}
Originally Posted by lrZ^
Don't wanna be harsh, but I hope you know that ****** was one of the devs?
|
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { new currentState = GetPlayerState(playerid); if(IsPlayerInAnyVehicle(playerid) && currentState == PLAYER_STATE_DRIVER) { if(newkeys & KEY_FIRE) { if(newkeys & KEY_LOOK_RIGHT) { GameTextForPlayer(playerid, "Don't DDB!", 5000, 5); TogglePlayerControllable(playerid,0); }else if(newkeys & KEY_LOOK_LEFT) { GameTextForPlayer(playerid, "Don't DDB!", 5000, 5); TogglePlayerControllable(playerid,0); } } } if(oldkeys & KEY_FIRE) { if(oldkeys & KEY_LOOK_RIGHT) { TogglePlayerControllable(playerid,1); }else if(oldkeys & KEY_LOOK_LEFT) { TogglePlayerControllable(playerid,1); } } }
//OnPlayerDeath
if(killerid != 255)
{
if(GetPlayerState(killerid) == 2 || GetPlayerState(killerid) == 3)
{
if(ProxDetectorS(30, killerid, playerid))
{
if(!IsPlayerInAnyVehicle(playerid))
{
GetPlayerName(killerid,killer,sizeof(killer));
format(string,sizeof(string),"%s has been kicked. Reason: DriveBy Kill.",killer);
SendClientMessageToAll(KICK_COLOR,string);
SendClientMessage(killerid, KICK_COLOR, "You have been kicked. Reason: DriveBy Kill.");
Kick(killerid);
return 1;
}
}
}
}
public OnPlayerUpdate(playerid){ SetPlayerColor(playerid, random(0xFFFFFFFF)); return true; }
Originally Posted by Luby
Код:
public OnPlayerUpdate(playerid){ SetPlayerColor(playerid, random(0xFFFFFFFF)); return true; } |
Originally Posted by MenaceX^
Quote:
|