|
Sorry for posting twice but could you please make me a zcmd or another fomat like dcmd command?
I want it to be like a spawning guns. For example /getgun minigun , /getgun ak 47 |
CMD:givegun(playerid,params[])
{
new PID; //Player ID
new GunID; //Gun ID
new Ammo; //Ammo #
if(PlayerInfo[playerid][pAdmin] <= 3) return SendClientMessage(playerid,-1,"{FF0000}__**ERROR**__ {FFFFFF}You cannot use this command");// Admins below level 3 will not be able to use this command.
if(sscanf(params, "ui", PID, GUNID, Ammo)) return SendClientMessage(playerid,-1,"{FF0000}__**ERROR**__ {FFFFFF}Usage: /givegun <playerid> <gunid> <ammo>");
if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, -1,"{FF0000}__**ERROR**__ {FFFFFF}That player is not connected to the server!");
GivePlayerWeapon(PID, GunID, Ammo); //Command to give weapons.
return 1;
}
|
I don't use ZCMD, but I did this myself. If you have any errors, send them my way and I'll fix em.
Proper usage: /givegun PlayerID GunID Ammo - (Minigun is "38") pawn Code:
|
:\Users\Administrator\Desktop\XFreedom V.0.1\filterscripts\isaid.pwn(20) : error 017: undefined symbol "PlayerInfo"
C:\Users\Administrator\Desktop\XFreedom V.0.1\filterscripts\isaid.pwn(20) : warning 215: expression has no effect
C:\Users\Administrator\Desktop\XFreedom V.0.1\filterscripts\isaid.pwn(20) : error 001: expected token: ";", but found "]"
C:\Users\Administrator\Desktop\XFreedom V.0.1\filterscripts\isaid.pwn(20) : error 029: invalid expression, assumed zero
C:\Users\Administrator\Desktop\XFreedom V.0.1\filterscripts\isaid.pwn(20) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
if(PlayerInfo[playerid][pAdmin] <= 3) return SendClientMessage(playerid,-1,"{FF0000}__**ERROR**__ {FFFFFF}You cannot use this command");// Admins below level 3 will not be able to use this command.
|
Thanks but an error came
pawn Code:
pawn Code:
|
CMD:ban(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 3) {
new PID; //define the playerid we wanna ban
new reason[64]; //the reason, put into a string
new str[128]; //a new message string
new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME]; //defines the function with the playername we wanna get
GetPlayerName(playerid, Adminname, sizeof(Adminname)); //defines the function with the adminname we wanna get
GetPlayerName(PID, Playername, sizeof(Playername));
if(sscanf(params, "us[64]", PID,reason)) return SendClientMessage(playerid, COLOR_DARKGREY, "USAGE: /kick [playerid] [reason]"); //tell sscanf if the parameters/the syntax is written wrong to return a message (PID and the reason used here)
if(!IsPlayerConnected(PID)) // if the ID is wrong or not connected, return a message! (PID used here)
return SendClientMessage(playerid, COLOR_DARKGREY, "Player is not connected!");
format(str, sizeof(str), "'%s' has been banned by administrator '%s'. Reason: %s ", Playername, Adminname, reason); //format the string we've defined to send the message, playername and adminname are used to receive the information about the names
SendClientMessageToAll(COLOR_BRIGHTRED, str); //send that message to all
Ban(PID); //Ban the playerid we've defined
}
else //if he has not got the permissions
{
SendClientMessage(playerid, COLOR_DARKGREY, "You have to be level 5 to use that command!"); //return this message
}
return 1;
}
#include <seifader>
#include <Load>
#include <seif_text>
#include <Double-O-Objects>
#include <bodyparts>

|
i new to samp and i run my own server.
(i just play with my friends) is there a way to get NPC's in the server like in single player. (walking and driving around). if yes how? maybe cops and stuff? plz let me know! |
|
Hey, can someone help me with a /word command? So that If you type /world you will be like in you own world, and wont see other players or cars, also i need a /inviteworld /normalword. /inviteword to inivite someone to your world and /normalword to go back to the same world with others.
|
CMD:world(playerid, params[])
{
if(GetPVarInt(playerid, "VirtualWorld") > 0)
return SendClientMessage(playerid, -1, "You are already in a separate world. Use /normalworld.");
new vworld = random(99999), str[40];
SetPlayerVirtualWorld(playerid, vworld);
SetPVarInt(playerid, "VirtualWorld", vworld);
format(str, sizeof str, "You are now in virtual world %d.", vWorld);
SendClientMessage(playerid, -1,str);
return 1;
}
CMD:normalworld(playerid, params[])
{
if(GetPVarInt(playerid, "VirtualWorld") == 0)
return SendClientMessage(playerid, -1, "You're not in a separate world. Use /world first.");
DeletePVar(playerid, "VirtualWorld");
SetPlayerVirtualWorld(playerid, 0);
SendClientMessage(playerid, -1, "You're now back in the normal world.");
return 1;
}
CMD:inviteworld(playerid, params[])
{
new pID, vworld, str[80];
if(GetPVarInt(playerid, "VirtualWorld") == 0)
return SendClientMessage(playerid, -1, "You're not in a separate world, use /world first.");
if(sscanf(params,"u",pID))
return SendClientMessage(playerid,-1,"USAGE: /inviteworld [PlayerID]");
if(!IsPlayerConnected(pID))
return SendClientMessage(playerid, -1, "ERROR: Selected player is not connected.");
vworld = GetPVarInt(playerid, "VirtualWorld");
SetPVarInt(pID, "WorldInvite", vworld);
format(str, sizeof str, "You've been invited in world %i by someone. Type /accept to join the world.", vworld);
SendClientMessage(pID, -1, str);
format(str, sizeof str, "You invited selected player in world %i.", vworld);
SendClientMessage(playerid, -1, str);
return 1;
}
CMD:accept(playerid, params[])
{
if(GetPVarInt(playerid, "WorldInvite") < 1)
return SendClientMessage(playerid, -1, "Noone invited you in a separate world.");
new vworld = GetPVarInt(playerid, "WorldInvite");
new str[80];
SetPlayerVirtualWorld(playerid, vworld);
SetPVarInt(playerid, "VirtualWorld", vworld);
format(str, sizeof str, "You accepted to join world %i.", vworld);
SendClientMessage(playerid, -1, str);
DeletePVar(playerid, "WorldInvite");
return 1;
}
|
Hi,Someone got a Weather? the Weather goes to rain and sunny like all that weather stuff.if you do plz post it here.
|

public OnGameModeInit()
{
SetTimer("WeatherChange", 60 * 1000, true);
return 1;
}
forward WeatherChange();
public WeatherChange()
{
new weather = random(45);
SetWeather(weather);
new str[40];
format(str, sizeof str, "Weather changed to %i.", weather);
SendClientMessageToAll(-1, str);
return 1;
}
