Added a check

This commit is contained in:
Jackzie 2020-06-17 12:52:34 -05:00
parent 92c2dd33ba
commit bd8823a3fc
No known key found for this signature in database
GPG key ID: 1E834FE36520537A
2 changed files with 6 additions and 2 deletions

Binary file not shown.

View file

@ -63,7 +63,11 @@ public Action Command_SpawnAIBot(int client, int args) {
if(args > 0) {
GetCmdArg(1, arg1, sizeof(arg1));
char model[64];
FindModelFromString(arg1, model, sizeof(model));
if(!FindSurvivorModel(arg1, model, sizeof(model))) {
LogError("Could not find a survivor model.");
ReplyToCommand(client, "Could not find that survivor.");
return Plugin_Handled;
}
//get ground:
float vPos[3], vAng[3];
@ -128,7 +132,7 @@ bool SpawnSurvivor(const float vPos[3], const float vAng[3], const char[] model,
return true;
}
stock bool FindModelFromString(const char str[16], char[] model, int modelStrSize) {
stock bool FindSurvivorModel(const char str[16], char[] model, int modelStrSize) {
int possibleNumber = StringToInt(str, 10);
if(modelStrSize == 1 && possibleNumber <= 7 && possibleNumber >= 0) {
switch(possibleNumber) {