15.03.2013, 12:55
is it possible to make an command only working for 1 guy ? i mean somehow put his name in the command that it only works then
CMD:mycommand(playerid, params[])
{
new playersname[MAX_PLAYER_NAME]; //Used to store the player's name
GetPlayerName(playerid, playersname, MAX_PLAYER_NAME); //Save the player's name to the variable
if(strcmp(playersname, "BenzoAMG", true) != 0) return SendClientMessage(playerid, 0xFF0000FF, "Only BenzoAMG can use this command!");
//rest of the command here
return 1;
}
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(!strcmp(name, "Your_name", true))
{
//your codes
}
public OnPlayerCommandText( playerid, cmdtext[ ] )
{
if( !strcmp( cmdtext, "/hello", true ) )
{
new
name[ MAX_PLAYER_NAME ]
;
GetPlayerName( playerid, name, MAX_PLAYER_NAME );
if( !strcmp( name, "kepa333", true ) ) SendClientMessage( playerid, -1, "Hello kepa333!" );
else SendClientMessage( playerid, -1, "You're not kepa333." );
return 1;
}
return 0;
}
Of course, you can!
pawn Код:
|
if(!strcmp(cmdtext, "/shayopen", true)) // By dylan
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid, 15, 311.20001220703, -1141.9000244141, 86.199996948242) || IsPlayerInRangeOfPoint(playerid, 6,311.8377,-1142.1458,5028.0552))
{
new
name[ MAX_PLAYER_NAME ]
;
GetPlayerName( playerid, name, MAX_PLAYER_NAME );
if( !strcmp( name, "kepa333", true ) ) SendClientMessage( playerid, -1, "Hello keppa!" );
else SendClientMessage( playerid, -1, "You're not kepa." );
if(shay1 == 0)
{
MoveDynamicObject(shaygate1, 311.89999389648, -1142.8000488281, 5026.5, 50.7500);
SendClientMessage(playerid, COLOR_BLUE,"Gate is open");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s takes his/her remote control and opens Gate.", sendername);
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
shay1 = 1;
}
else
{
MoveDynamicObject(shaygate1, 311.20001220703, -1141.9000244141, 50.199996948242, 50.0000);
SendClientMessage(playerid, COLOR_BLUE,"Gate is closed");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s takes his/her remote control and closes Gate.", sendername);
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
shay1 = 0;
}
}
}
return 1;
}
i did this
PHP код:
help me out of here pls |