09.03.2011, 12:26
Did you even change the 0.0, 0.0, 0.6 ?
i wanna add if player did /slap 0
without a reason it will slap and says reason not specified how to do it thanks |
CMD:slap( playerid, params[ ] )
{
new ID, string[200], reason[66], Float:x, Float:y, Float:z, Float:Health;
new aName[MAX_PLAYER_NAME], pName[MAX_PLAYER_NAME];
if(sscanf(params, "uS(Not Specified)[65]", ID, reason)) return SendClientMessage(playerid, -1, "USAGE: /slap [PlayerID] [Reason]");
if(IsPlayerConnected(ID) && ID != INVALID_PLAYER_ID && ID != playerid)
{
GetPlayerName(playerid, aName, MAX_PLAYER_NAME);
GetPlayerName(ID, pName, MAX_PLAYER_NAME);
GetPlayerHealth(ID,Health);
SetPlayerHealth(ID,Health-25);
GetPlayerPos(ID,x,y,z);
SetPlayerPos(ID,x,y,z+5);
PlayerPlaySound(ID,1190,0.0,0.0,0.0);
format(string,sizeof(string),"AdmCmd: %s was Slapped by Admin %s Reason: %s",pName, aName, reason);
SendClientMessageToAll(-1,string);
}
else return SendClientMessage(playerid, -1, "ERROR: Player is not connected or is yourself.");
return 1;
}
if(strcmp(cmd, "/newbie", true) == 0 || strcmp(cmd, "/new", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMuted] == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "You cannot speak, you have been silenced");
return 1;
}
if(nonewbie == 1)
{
SendClientMessage(playerid, TEAM_CYAN_COLOR, "Newbie chat is off.");
return 1;
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/n)ewbie [newbie chat]");
return 1;
}
if(PlayerInfo[playerid][pHelper] == 0)
{
format(string, sizeof(string), "[Newbie]: Newbie %s: %s", sendername, result);
}
else if(PlayerInfo[playerid][pHelper] == 1)
{
format(string, sizeof(string), "[Newbie]: Helper %s: %s", sendername, result);
}
else if(PlayerInfo[playerid][pHelper] == 2)
{
format(string, sizeof(string), "[Newbie]: Master %s: %s", sendername, result);
}
else if(PlayerInfo[playerid][pHelper] == 3)
{
format(string, sizeof(string), "[Newbie]: Administrator %s: %s", sendername, result);
}
SendClientMessageToAll(0x62B382AA, string);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string, sizeof(string), "[%d/%d/%d](%d:%d:%d) %s (newbie): (%s)",d,m,y,h,mi,s, sendername, result);
ChatLog(string);
}
return 1;
}
Could someone script me the most easiet /pay command to transfer cash from one player to another, thank you
|
CMD:pay(playerid, params[])
{
new tempname, temppay;
if( sscanf( params, "ui", tempname, temppay ) )
return SendClientMessage( playerid, -1,"Usage: /pay [PlayerID] [Amount]" );
if( tempname == playerid )
return SendClientMessage( playerid, -1,"You can't pay to yourself." );
if( GetPlayerMoney( playerid ) < temppay )
return SendClientMessage( playerid, -1, "You don`t have that much." );
new Float:dpX, Float:dpY, Float:dpZ;
GetPlayerPos( tempname, dpX, dpY, dpZ );
if ( !IsPlayerInRangeOfPoint( playerid, 3, dpX, dpY, dpZ ) )
return SendClientMessage( playerid, -1, "This player is not near you." );
GivePlayerMoney( tempname, temppay);
GivePlayerMoney( playerid, - temppay );
return 1;
}
if(strcmp("/pm", cmd, true) == 0)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp) || strlen(tmp) > 5) {
SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"Usage: /pm (id) (message)");
return 1;
}
new id = strval(tmp);
gMessage = strrest(cmdtext,idx);
if(!strlen(gMessage)) {
SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"Usage: /pm (id) (message)");
return 1;
}
if(!IsPlayerConnected(id)) {
SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"/pm : Bad player ID");
return 1;
}
if(playerid != id) {
GetPlayerName(id,iName,sizeof(iName));
GetPlayerName(playerid,pName,sizeof(pName));
format(Message,sizeof(Message),"[PM] Message send to %s(%d): %s",iName,id,gMessage);
SendClientMessage(playerid,PM_OUTGOING_COLOR,Message);
format(Message,sizeof(Message),"[PM] Message received from %s(%d): %s",pName,playerid,gMessage);
SendClientMessage(id,PM_INCOMING_COLOR,Message);
GameTextForPlayer(id, "[PM] Message received !", 1250, 1);
PlayerPlaySound(id,1057,0.0,0.0,0.0);
printf("PM: %s",Message);
}
else {
SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"You cannot PM yourself");
}
return 1;
}
//Somewhere outside
CMD:pm(playerid, cmdtext[])
{
new
idx = strfind(cmdtext, " ", true);
if((cmdtext[0] == EOS) || ((cmdtext[0] == '\1') && (cmdtext[1] == EOS)) || (idx == -1)) {
SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"Usage: /pm (id) (message)");
return 1;
}
if(cmdtext[idx + 1] == EOS) {
SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"Usage: /pm (id) (message)");
return 1;
}
cmdtext[idx++] = EOS;
new
id = strval(cmdtext);
if(!IsPlayerConnected(id)) {
SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"/pm : Bad player ID");
return 1;
}
if(playerid == id) {
SendClientMessage(playerid,ADMINFS_MESSAGE_COLOR,"You cannot PM yourself");
return 1;
}
new
string[256];
GetPlayerName(id, string, MAX_PLAYER_NAME);
format(string, sizeof string, "[PM] Message send to %s(%d): %s", string, id, cmdtext[idx]);
SendClientMessage(playerid, PM_OUTGOING_COLOR, string);
GetPlayerName(playerid, string, MAX_PLAYER_NAME);
format(string, sizeof string, "[PM] Message received from %s(%d): %s", string, playerid, cmdtext[idx]);
GameTextForPlayer(id, "[PM] Message received !", 1250, 1);
SendClientMessage(id, PM_INCOMING_COLOR, string);
PlayerPlaySound(id, 1057, 0.0, 0.0, 0.0);
printf("PM: %s", cmdtext[idx]);
return 1;
}
pawn Код:
|
if(strcmp("/heal", cmd, true) == 0)
{
if (gTeam[playerid] == MEDIC)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp))
{
return SendClientMessage(playerid,COLOR_LIGHTBLUE,"USAGE: /heal [id]");
}
new id = strval(tmp);
new pid = playerid;
if(!IsPlayerConnected(id))
{
return SendClientMessage(playerid,COLOR_GREY,"AdmCmd: This player is not online!");
}
new Float:X,Float:Y,Float:Z, string[128], name[MAX_PLAYER_NAME];
GetPlayerName(id,name,128);
GetPlayerPos(id,X,Y,Z);
if(IsPlayerInRangeOfPoint(playerid,3,X,Y,Z))
{
format(string,128,"[INFO] Medic %s[%d] has healed you!", name, pid);
SetPlayerHealth(id,100);
SendClientMessage(id,COLOR_GREY,string);
return 1;
}
else
{
SendClientMessage(playerid,COLOR_RED,"You're not near the player!");
}
}
else
{
SendClientMessage(playerid,COLOR_RED,"You're not a Medic!");
return 1;
}
}
What do you mean with "+ fs commands in Destruction Derby"
A normal teleport command which teleports you in the derby stadium "Arena will be in lv, 1k biletu pay" Or do you want to recreate a the derby area ? No clue what you mean with 1k biletu pay "know what I mean" No |